PC Review


Reply
Thread Tools Rate Thread

Multiple criteria on StLinkCriteria

 
 
New Member
Join Date: Jun 2012
Posts: 1
 
      29th Jun 2012
Hello,

I created a table-based form that contains a button that opens other form. I want that the new form keep the user id and the visit number (both text boxes with numbers)

I typed the following code, but I get "Type Mismatch":


Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "VISIT"

stLinkCriteria = "[User_Id]=" & Me![User_Id] And "[visit_number] =" & Me![visit_number]
DoCmd.OpenForm stDocName, , , stLinkCriteria


I've also tried this but Access asks me the visit number


stLinkCriteria = "([User_Id]=" & Me![User_Id] & ") And ([visit_number] =" & Me![visit_number] & ")"



Does anybody know can I solve this?

Thank you in advance for your help

Irene
 
Reply With Quote
 
 
 
 
New Member
Join Date: Mar 2013
Posts: 1
 
      22nd Mar 2013
hi irene
i have the same problem you have and few min ago i found the solution
i will be glad to help you if you still need it
any way
here is your sentence
stLinkCriteria = "[User_Id]=" & Me![User_Id] &"And"& "[visit_number] =" & Me![visit_number]

all i did is putting and between " to be inside the criteria
i hope you will read this
and you can email me any time
thanx
bye
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Multiple criteria on StLinkCriteria =?Utf-8?B?ZWx5c2U=?= Microsoft Access Forms 3 26th Jun 2011 12:12 AM
stLinkCriteria Statement with multiple criteria imelda1ab Microsoft Access Form Coding 4 5th Nov 2010 07:55 PM
stLinkCriteria - with Multiple criteria Berny Microsoft Access Forms 6 18th Dec 2005 07:11 AM
stLinkCriteria - with Multiple criteria Berny Microsoft Access Form Coding 6 18th Dec 2005 07:11 AM
stLinkCriteria - Multiple criteria Rick Microsoft Access Forms 4 12th Dec 2005 06:00 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:52 PM.