Need Advise

M

Michael Lam

I have created a form to allow user to keyin value
After click the save /Add records button , Autogen Ref No will be assigned
to this records

I want to create a buttons to print out current records only ? How ?

I have created a query to select the current records by Ref No
how can the new created Ref No pass value to the query ?
In the query wizard, there is a field called parameter or regulation
I have try to key in as follow

=[Form]![RequestForm]![RefNo]

am I correct?

THX

Michael Lam


I have created the code as below but dont work
Please comment

Private Sub Command47_Click()
On Error GoTo Err_Command47_Click

Dim rs As Object
Dim stDocName As String

stDocName = "RequestFormPrint"
rs = RequestFormQuery

DoCmd.OpenQuery rs, acNormal, acEdit

DoCmd.OpenReport stDocName, acPreview

Exit_Command47_Click:
Exit Sub

Err_Command47_Click:
MsgBox Err.Description
Resume Exit_Command47_Click

End Sub

Best regards
Michael
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top