Hi - I have frmCompany which is the main form.
There is a button on this form that opens the frmSearch form which is basically a 'Company Name' field (to allow the user to enter the first few letters of a company name), and then a 'Search' button (which builds a SQL string that modifys the querydef.SQL for the query on which frmCompany is based).
The code behind the 'Search' button should a)modify the qryCompany, b)Refresh/Requery the frmCompany, c)close the Search form
I am having trouble with the refresh/requery bit - searched the forums but I'm doing what everyone is suggesting. I have tried the lines:
Forms!frmCompany.ReQuery
Forms!frmCompany.Refresh
but it does not properly refresh/requery the form (The one thing that does work, is my 'Record x of y' counter updates!). However, if I close the main form, and open it again, the new information is correctly displayed! So at the moment I am using the lines:
DoCmd.Close acForm, ("frmCompany")
DoCmd.OpenForm "frmCompany"
- but this is messy, and look bad on-screen.... surely there must be a neater way?
Any help much appreciated
Dale
Manchester, UK
There is a button on this form that opens the frmSearch form which is basically a 'Company Name' field (to allow the user to enter the first few letters of a company name), and then a 'Search' button (which builds a SQL string that modifys the querydef.SQL for the query on which frmCompany is based).
The code behind the 'Search' button should a)modify the qryCompany, b)Refresh/Requery the frmCompany, c)close the Search form
I am having trouble with the refresh/requery bit - searched the forums but I'm doing what everyone is suggesting. I have tried the lines:
Forms!frmCompany.ReQuery
Forms!frmCompany.Refresh
but it does not properly refresh/requery the form (The one thing that does work, is my 'Record x of y' counter updates!). However, if I close the main form, and open it again, the new information is correctly displayed! So at the moment I am using the lines:
DoCmd.Close acForm, ("frmCompany")
DoCmd.OpenForm "frmCompany"
- but this is messy, and look bad on-screen.... surely there must be a neater way?
Any help much appreciated
Dale
Manchester, UK