papadega3000
Registered User.
- Local time
- Today, 17:15
- Joined
- Jun 21, 2007
- Messages
- 80
I have a from with several pages that house queries. What I wanted to accompolish was a simple search to narrow down the data in the queries.
I added another page to the form and setup combo boxes that have a record source to the appropriate fields I want to search by. I also have this line of code in Query Builder:
[FieldA]=[Forms]![FormName]![ComboBoxName] Or [Forms]![FormName]![ComboBoxName] Is Null= True
This will set the query to to read from the Combo box and if Nothing selected report everything. This works fine. The problem I am running into is When I want to open up the form I get prompted to enter values into those fields in separate windows... I want to be able to just open the form and be looking at the search page not having to hit the 'OK' button 7 times to view the form.
My idea was to try and trick the form into thiinking it has data. I made a sub routine in the Form_Load() similar to this:
Private Sub Form_Load()
[Forms]![FormName]![ComboBoxName] = 1
[Forms]![FormName]![ComboBoxName] = 1
[Forms]![FormName]![ComboBoxName] = 1
End Sub
My thoughts were that it would take on these values and then pull up the search page and then I could hit the search button and it would requery all the tables.
If there is a way I could do this either with code or inside the form properties I would appreciate the assistence. Meanwhile I will keep trying.
Thanks in advance.
I added another page to the form and setup combo boxes that have a record source to the appropriate fields I want to search by. I also have this line of code in Query Builder:
[FieldA]=[Forms]![FormName]![ComboBoxName] Or [Forms]![FormName]![ComboBoxName] Is Null= True
This will set the query to to read from the Combo box and if Nothing selected report everything. This works fine. The problem I am running into is When I want to open up the form I get prompted to enter values into those fields in separate windows... I want to be able to just open the form and be looking at the search page not having to hit the 'OK' button 7 times to view the form.
My idea was to try and trick the form into thiinking it has data. I made a sub routine in the Form_Load() similar to this:
Private Sub Form_Load()
[Forms]![FormName]![ComboBoxName] = 1
[Forms]![FormName]![ComboBoxName] = 1
[Forms]![FormName]![ComboBoxName] = 1
End Sub
My thoughts were that it would take on these values and then pull up the search page and then I could hit the search button and it would requery all the tables.
If there is a way I could do this either with code or inside the form properties I would appreciate the assistence. Meanwhile I will keep trying.
Thanks in advance.