By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,136 Members | 1,089 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,136 IT Pros & Developers. It's quick & easy.

query questions

P: n/a
I have a form linked to a table. In the form I have a textbox, a
command button, and a query subform.
I dragged the query onto the form to create the query subform.
The query has a field named SerialNumber. In the criteria for the
query, I have [forms]![frmlookup]![txtSN] which links the query to the
textbox in the main form.

Code for the form:

Private Sub cmdShow2_Click()
On Error GoTo Err_cmdShow2_Click

Dim stDocName As String

stDocName = "Lookup Query"
Me.Lookup_Query_subform2.SetFocus
DoCmd.OpenQuery stDocName, acNormal, acEdit

'Me.Lookup_Query_subform2.SourceObject = "select * from [DCT
Repair] where [DCT Repair].[Serial Number] = txtSN.text"

'DoCmd.DoMenuItem acFormBar, acEditMenu, 10, , acMenuVer70
'Me.RecordsetClone.FindFirst Me.txtSN
'Me.Bookmark = Me.RecordsetClone.Bookmark
Exit_cmdShow2_Click:
Exit Sub

Err_cmdShow2_Click:
MsgBox Err.Description
Resume Exit_cmdShow2_Click
End Sub

Private Sub Form_Load()

Me.Lookup_Query_subform2.Form.NavigationButtons = False

End Sub
Problem: when I open the main form, the subform automatically gets
populated with the first record of the Table. I need this to be clear
when it opens.

Problem: I need the subform navigation buttons to be turned off. I
cannot find an option to turn them off in the subform.

Biggest Problem: when I enter a serial number in the text box and
click the button, the query opens in a separate window. I need it to
be in a box, or preferably in the subform.

Any solutions for this would be greatly appreciated.

Mar 1 '06 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.