S
SherryScrapDog
I have a names table, with Last, First, Middle and Title fields (for
genealogy) where I want to enter a name or partial name and have a form come
up with Last names beginning with what was entered and ending with the last
record that begins with what was entered. I believe using 'Like' works well
for this, but am having trouble getting the code to work. I get a compile and
syntax error on the following attempt:
stLinkCriteria = "select * from Master where [Last] like " & Chr(34) &
Me![Name] & Char(34) "*' order by [Last], [First], [Middle], [Title]"
With this attempt, I get all of the records (note: Text4 is the value of
Entry&"zz"):
strLinkCriteria = "select * from Master where [Last] between " ' &
Me![Entry] & '" and "' & Me![Text4]'"
I'm not good at VBA yet and these are just two of several attempts I have
made by looking for other examples. (I'm trying to use Chr(34) instead of '
because I have names, such as O'Hara, with ' in them.)
This has a sub-form (for the results) within the Search form. Any help?
Thanks in advance if you can help! Thanks, Sherry
genealogy) where I want to enter a name or partial name and have a form come
up with Last names beginning with what was entered and ending with the last
record that begins with what was entered. I believe using 'Like' works well
for this, but am having trouble getting the code to work. I get a compile and
syntax error on the following attempt:
stLinkCriteria = "select * from Master where [Last] like " & Chr(34) &
Me![Name] & Char(34) "*' order by [Last], [First], [Middle], [Title]"
With this attempt, I get all of the records (note: Text4 is the value of
Entry&"zz"):
strLinkCriteria = "select * from Master where [Last] between " ' &
Me![Entry] & '" and "' & Me![Text4]'"
I'm not good at VBA yet and these are just two of several attempts I have
made by looking for other examples. (I'm trying to use Chr(34) instead of '
because I have names, such as O'Hara, with ' in them.)
This has a sub-form (for the results) within the Search form. Any help?
Thanks in advance if you can help! Thanks, Sherry