Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Refreshing a Forms Data

Status
Not open for further replies.

BobLoblaws

Programmer
Nov 20, 2001
149
CA
I have a form that I created through the wizard.
It is a columnar form.
At the top of the form there is a textbox. When a customerID is typed into the textbox and enter is hit, the query is changed to only select that customers records.
Then the rows of records are displayed in the underneath.
The default query is select none. That works when the form opens.
When I type the customer and hit enter, it changes the query correctly.
The problem is that I cannot get the form to re-select the data from the query.

I have tried Requery, Recalc...
What am I missing?

Thanks
 
I think this will work:

Me.Filter = ""
Me.Requery Jim Lunde
compugeeks@hotmail.com
We all agree your theory is crazy, but is it crazy enough?
 
Try this:

Me.sbfrmStores.Form.Filter = ""
Me.sbfrmStores.Form.Requery Jim Lunde
compugeeks@hotmail.com
We all agree your theory is crazy, but is it crazy enough?
 
This is the onclick event for a command button

Private Sub cmdGetInfo_Click()

Dim qd

Set qd = CurrentDb.QueryDefs("qryTest")
txtCustomer.SetFocus
qd.SQL = "SELECT * FROM tblTest WHERE PartID='" & txtCustomer.Text & "';"
qd.Close

Me.frmSubForm.Form.Filter = ""
Me.frmSubForm.Form.Requery

End Sub

The subform pulls it's info from qryTest.
The query updates, but the subform is not pulling the correct information. It keeps pulling the info it already has. ???
 
I tried this and it works.

Me.frmSubForm.Form.RecordSource = "SELECT * FROM tblTest WHERE PartID='" & txtCustomer.Text & "';"
Me.frmSubForm.Form.Requery

Thanks for your help. :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top