Doug Murphy
dw-murphy at cox.net
Mon Sep 10 23:13:04 CDT 2007
OK I'll try again with a simpler (?) question.
Any one see a reason why the following sql string generates an error when
used to open a recordset?
"Select * From tblUserFormat Where fldCountry = 'United States';"
Generates an error 3075 when run in the following line:
"Set rs = db.OpenRecordset(sSQL, dbOpenDynaset)"
The error message that gives the error number 3075 indicates that there is
some problem with fldCountry = 'United States'
I have modified the code slightly from my first post to use a dynaset type
recordset and added the semicolon at the end of the query string. Same
error is generated with the updated code. The complete procedure up to this
point is as follows.
Public Sub GetCountrySettings()
Dim rs As DAO.Recordset
Dim db As DAO.Database
Dim sSQL As String
Dim sCountrySettings As String
Dim fld As Field
Dim LCID As Long
LCID = 0 'GetSystemDefaultLCID()
On Error GoTo GetCountrySettings_Error
sCountrySettings = GetUserLocaleInfo(LCID, LOCALE_SCOUNTRY)
tFM.sCountry = sCountrySettings
If Not IsNull(sSQL) Then
sSQL = "Select * From tblUserFormat Where fldCountry = '" &
sCountrySettings & "';"
Set db = CurrentDb
Set rs = db.OpenRecordset(sSQL, dbOpenDynaset)
rs.MoveFirst