I have a form with txtSN text box, btnShow button, and a subform. The
form is bound to a Table. The button is bound to a lookup query. The
query is bound to the text box.
I want to be able to show the query inside a box on the form using the
button.
When I run the form, the subform gets populated with the first record
of the Table. I do not want this to occur. I want it to be blank or
not visible til I click the Show button.
When I run the form, the query pops up as a separate page, which looks
ugly and hides some of the other items on the form. I want it to pop
up inside the subform.
The query does not have to be inside a subform, just a box which I can
set the size of it.
Here is the code I use for the Show button:
Private Sub cmdShow2_Click( )
On Error GoTo Err_cmdShow2_Cl ick
Dim stDocName As String
stDocName = "Lookup Query"
DoCmd.OpenQuery stDocName, acNormal, acEdit
Exit_cmdShow2_C lick:
Exit Sub
Err_cmdShow2_Cl ick:
MsgBox Err.Description
Resume Exit_cmdShow2_C lick
End Sub
Any help will be greatly appreciated.
form is bound to a Table. The button is bound to a lookup query. The
query is bound to the text box.
I want to be able to show the query inside a box on the form using the
button.
When I run the form, the subform gets populated with the first record
of the Table. I do not want this to occur. I want it to be blank or
not visible til I click the Show button.
When I run the form, the query pops up as a separate page, which looks
ugly and hides some of the other items on the form. I want it to pop
up inside the subform.
The query does not have to be inside a subform, just a box which I can
set the size of it.
Here is the code I use for the Show button:
Private Sub cmdShow2_Click( )
On Error GoTo Err_cmdShow2_Cl ick
Dim stDocName As String
stDocName = "Lookup Query"
DoCmd.OpenQuery stDocName, acNormal, acEdit
Exit_cmdShow2_C lick:
Exit Sub
Err_cmdShow2_Cl ick:
MsgBox Err.Description
Resume Exit_cmdShow2_C lick
End Sub
Any help will be greatly appreciated.
Comment