Sep 19, 2001 #1 kavya Programmer Joined Feb 21, 2001 Messages 83 Location US ssql = "select membersshipid from lookmembrship where membershipcode = " & Me.PriorExamAuthority if me.priorexamauthority is a string then how would the syntax be. Thanks
ssql = "select membersshipid from lookmembrship where membershipcode = " & Me.PriorExamAuthority if me.priorexamauthority is a string then how would the syntax be. Thanks
Sep 19, 2001 #2 Nancy2 Programmer Joined Sep 18, 2001 Messages 97 Location US Not sure what you are using this for but you would need to add &"'" to the end to close off the string for the ssql variable Upvote 0 Downvote
Not sure what you are using this for but you would need to add &"'" to the end to close off the string for the ssql variable
Sep 19, 2001 #3 Fred MIS Joined Sep 15, 1998 Messages 13 Location US The correct syntax would be: Code: sSql = "select MembersShipId from LookMembrShip where MemberShipCode = '" & Me.PriorExamAuthority & "'" Since Me.PriorEamAuthority is a string, you must surround it by single quotes. This will only work if Me.PriorExamAuthority doesn't contain any embedded single quotes. Upvote 0 Downvote
The correct syntax would be: Code: sSql = "select MembersShipId from LookMembrShip where MemberShipCode = '" & Me.PriorExamAuthority & "'" Since Me.PriorEamAuthority is a string, you must surround it by single quotes. This will only work if Me.PriorExamAuthority doesn't contain any embedded single quotes.
Sep 19, 2001 Thread starter #4 kavya Programmer Joined Feb 21, 2001 Messages 83 Location US Thanks guys Upvote 0 Downvote