Command Button Wizard not working

G

Grace

Hello, I have a form that contains a button I created
using the Command Button Wizard. The button opens a new
form and uses a filter to display data on the newly opened
form. The filtered field is [PIN].

Here is the code that the wizard generated on the "Add New
Ticket" button:

Private Sub New_Ticket_Click()
On Error GoTo Err_New_Ticket_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "FormHelpDeskLogCreate"

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

Exit_New_Ticket_Click:
Exit Sub

Err_New_Ticket_Click:
MsgBox Err.Description
Resume Exit_New_Ticket_Click

End Sub

This WAS working fine but all of a sudden it stopped
working and will not carry over the [PIN] on the next
form???? HELP. What do you think could of caused it? Is
this another one of those Access bugs?

Thanks for your help in advance.
 
A

Art

I'm not a guru but what I would do is put a breakpoint at
the beginning of that code. Click on the button and then
step through the code to see what value it is picking up
for PIN. This value may have changed to something it can't
handle.

Hope this helps
 

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