command button on form help

N

nydia

I have a form with a command button that opens up a
questionaire. They are linked together by clientID. But,
when you click on the command button, it opens up the
questionaire and hides the name, address on the other form
and if a clientID is not entered into the questionaire, it
will not show up the next time you open up the questionair
for that client. I used the wizard to create this button
and below is the code it uses on click. Can someone
please help me fix this. I'm obviously not an expert and
dont understand all the terms, so can you please be
specific when helping, it's greatly appreciated.

Private Sub Command29_Click()
On Error GoTo Err_Command29_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "frmWorkBehaviorsQuestionaire"

stLinkCriteria = "[ClientID]=" & "'" & Me![ClientID]
& "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_Command29_Click:
Exit Sub

Err_Command29_Click:
MsgBox Err.Description
Resume Exit_Command29_Click

End Sub
 

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

Similar Threads


Top