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

Opening a Form based on two sets of Criteria

100+
P: 129
Hi, i am trying to open a form based on two ID's which are present on both forms and are numeric, i know it is probably the way i am using the "" but i have tried many different ways.

Expand|Select|Wrap|Line Numbers
  1.     Dim stDocName As String
  2.  
  3.     stDocName = "frmGrainEquations"
  4.     stLinkCriteria = ("[SubStkID] =" & Me![SubStkID] And "[CmpID] =" & Me![CmpID])
  5.  
  6. 'Testing of code writing!    
  7. '"[SubStkID] =" & Me![SubStkID] & " AND [CmpID] ='" & [CmpID] & "'
  8.  
  9.     DoCmd.OpenForm stDocName, acNormal, , stLinkCriteria
Can anyone tell me where i am going wrong please?
Aug 26 '08 #1
Share this Question
Share on Google+
3 Replies


100+
P: 167
Try this:
Expand|Select|Wrap|Line Numbers
  1. stLinkCriteria = ("[SubStkID] = " & Me![SubStkID] & "And [CmpID] = " & Me![CmpID])
Aug 26 '08 #2

100+
P: 129
Try this:
Expand|Select|Wrap|Line Numbers
  1. stLinkCriteria = ("[SubStkID] = " & Me![SubStkID] & "And [CmpID] = " & Me![CmpID])
Thankyou very much, it works fine now!
Aug 26 '08 #3

100+
P: 167
You're welcome Constantine.
Good job for you coming so close!
Aug 27 '08 #4

Post your reply

Sign in to post your reply or Sign up for a free account.