PDA

Click to See Complete Forum and Search --> : Refreshing


Jbajin
Jun 27th, 2000, 12:52 AM
I can't figure out how after making an SQL statement to get the results back to the main form. It looks like it searches, finds the record and then the form disappears and the new information doesn't appear. Any help would be great.

Altecjjf
Jun 27th, 2000, 01:23 AM
Did you try the REFRESH staement.
Updates the objects in a collection to reflect the current database's schema.

Syntax

collection.Refresh

The collection placeholder is an object variable that represents a persistent collection.

JHausmann
Jun 27th, 2000, 02:56 AM
Can you post the code?

Jbajin
Jun 27th, 2000, 03:01 AM
here is the Code.

Private Sub SearchButton_Click()
Dim fieldStr As String
Dim searchStr As String
searchStr = Form1.SearchString
fieldStr = Form1.ComboSelect.Text


frmMain.Gold.RecordSource = "SELECT * FROM [GOLD] WHERE " &
"[" & fieldStr & "] = '" & searchStr & _
"'"

frmMain.Gold.Refresh
Form1.Hide
End Sub



Joe

Jbajin
Jun 28th, 2000, 02:06 AM
Yeah Gold is my data control for the program. It holds our database.

JHausmann
Jun 29th, 2000, 01:48 AM
Sadly, data controls are not my forte. Is control being set to frmmain once you hide from1? Does a formmain.refresh (or formmain.show) help?

[Edited by JHausmann on 06-29-2000 at 03:06 PM]

Jimmer
Jun 29th, 2000, 02:01 AM
What are you using to show the retrieved data in, a datagrid, text boxes, etc???
You may need to refresh these connections to the data control. If it is a grid, you could try rebinding the grid and this might work.