Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

question on select statement

Status
Not open for further replies.

kavya

Programmer
Feb 21, 2001
83
0
0
US

ssql = "select membersshipid from lookmembrship where membershipcode = " & Me.PriorExamAuthority


if me.priorexamauthority is a string then how would the syntax be.

Thanks
 
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


 
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.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top