Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a worksheet which houses changing data rows. To Update this
data I use a UserForm for staff to make appropriate changes, then run a macro which update an Access Database using Select Clause, From, Where. As the database has numberous records from many staff menbers I need the Where Clause to search for two variables. The code sets up the variables without problem, but the Where clause is in error and no records are selected. Here is my code: LG = Range("G" & 1).Value 'The Staff ID Qry = "LOG" & LG For R = 4 To 300 ColB = Worksheets("Contacts").Cells(R, 2).Value If ColB = "E" Then Exit For ' Marked for editing Next R SSN = Range("G" & R).Value 'Rows unique identifier- Claimants SSN adjlog = "\\xxxx.mdb" Set dbs = OpenDatabase(adjlog) Set qd = dbs.CreateQueryDef(Qry) qd.SQL = "SELECT * FROM TEntry " _ & "WHERE [Login] = 'LG' AND [SSN] ='SSN';" Set rs = dbs.OpenRecordset(Qry) Fails here as rs = Nothing. This is the final part of this new code to impliment the Worksheet, Appreciate any help. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
PERCENTILE with an IF Clause | Excel Worksheet Functions | |||
IF clause for a range of cells | Excel Worksheet Functions | |||
$ sign in SQL clause in MS Query | Excel Discussion (Misc queries) | |||
IF Clause | Excel Worksheet Functions | |||
"Between" in an IF clause | Excel Discussion (Misc queries) |