G
Guest
Hiya
I have a problem with a recordset. I am trying to get the first record where a value matches the value of a string variable (cborecipient). This is the code
Dim dbs as Databas
Dim rst As Recordse
Set dbs = CurrentD
Set rst = dbs.OpenRecordset("Referring Trusts", dbOpenDynaset
rst.FindFirst ("[National Site/Trust Name] = '" & cborecipient & "'"
The problem is that sometimes the cborecipient string has an apostrophe in it (eg "St Mary's)
Do you know what I can do about this to stop an error occuring (Missing syntax) because of the extra apostrophe it will read? The table is nationally set, so I cannot simply remove the 's - I will need the look up to include it
Thanks for any help
T
I have a problem with a recordset. I am trying to get the first record where a value matches the value of a string variable (cborecipient). This is the code
Dim dbs as Databas
Dim rst As Recordse
Set dbs = CurrentD
Set rst = dbs.OpenRecordset("Referring Trusts", dbOpenDynaset
rst.FindFirst ("[National Site/Trust Name] = '" & cborecipient & "'"
The problem is that sometimes the cborecipient string has an apostrophe in it (eg "St Mary's)
Do you know what I can do about this to stop an error occuring (Missing syntax) because of the extra apostrophe it will read? The table is nationally set, so I cannot simply remove the 's - I will need the look up to include it
Thanks for any help
T