manix
Registered User.
- Local time
 - Today, 14:01
 
- Joined
 - Nov 29, 2006
 
- Messages
 - 100
 
Hi all,
I am really stuck as to why this is happening. I have the following code, whereby a button opens a form on a certain record depending upon the part number field selected on the current form.
The code used for this button is as follows:
	
	
	
		
I keep getting the 2501 error code and it won't open frm_partdata I have checked the forms on open properties and these are clear. Putting a breakpoint in the code I can see it is picking up the right form and the right part number! What am I doing wrong, it works in my other DB's!!!!
Edit: the part number fields are all TEXT fields.
 I am really stuck as to why this is happening. I have the following code, whereby a button opens a form on a certain record depending upon the part number field selected on the current form.
The code used for this button is as follows:
		Code:
	
	
	Private Sub showrecord_Click()
    Dim stDocName As String
    Dim stLinkCriteria As String
    stDocName = "frm_partdata"
    
    stLinkCriteria = "[Part Number]=" & Me![Part Number]
    DoCmd.OpenForm stDocName, , , stLinkCriteria
End Sub
	I keep getting the 2501 error code and it won't open frm_partdata I have checked the forms on open properties and these are clear. Putting a breakpoint in the code I can see it is picking up the right form and the right part number! What am I doing wrong, it works in my other DB's!!!!
Edit: the part number fields are all TEXT fields.