A
Alan
Sorry thought I had problem Sorted
I have a table that keeps information about places of work, Location, Dept
ID etc which I call to my Form using
Public Sub AssignVariables()
Dim rstVar As Recordset
Set rstVar = CurrentDb.OpenRecordset("tblVariables", dbOpenDynaset)
With rstVar
.FindFirst "[DEPTID] = '" & Me.OpenArgs & "'"
OFFICE = .Fields("OFFICES")
AREA = .Fields("LOCATION")
ROLE = .Fields("JOB DESC")
DEPARTMENT = .Fields("DEPTID")
End With
End Sub
The OpenArgs Variable is defined dependant on button press in First Form
when opened.
Currently this information populates variables in my SQL code in the rest of
my procedure. However will not populate if I call SQL Code from another table
using DLookup...
I may again be missing something obvious ... but pulling my hair out
May be my code just has to remain messy ??
Any help again would be gratefully appreciated
I have a table that keeps information about places of work, Location, Dept
ID etc which I call to my Form using
Public Sub AssignVariables()
Dim rstVar As Recordset
Set rstVar = CurrentDb.OpenRecordset("tblVariables", dbOpenDynaset)
With rstVar
.FindFirst "[DEPTID] = '" & Me.OpenArgs & "'"
OFFICE = .Fields("OFFICES")
AREA = .Fields("LOCATION")
ROLE = .Fields("JOB DESC")
DEPARTMENT = .Fields("DEPTID")
End With
End Sub
The OpenArgs Variable is defined dependant on button press in First Form
when opened.
Currently this information populates variables in my SQL code in the rest of
my procedure. However will not populate if I call SQL Code from another table
using DLookup...
I may again be missing something obvious ... but pulling my hair out
May be my code just has to remain messy ??
Any help again would be gratefully appreciated