B
babs
I have a drop downlist in a subform (cleaning jobs) main from is the one side
- who is the employee and subform shows what many jobs the boss is assigning
them.
For the bosses sake I would like the joblocautnum to list ALL JObs at the
given locations that have NOT yet been assigned for that given Date. Thought
I would create an after update event for the next record- Not sure if this is
the correct place to put it - and somewhere else??? that would include all
jobs at the location but NOT the ones already assigned for that day.
I am sure I am messing up on the syntax somewhere.
I get the drop down and select the joblocautonum for the first record in the
subform fine when I go to the next record in the subform to assign the next
job and hoping that the one I just assigned for that day is not available - I
get two errors and then see the drop down list WITH ALL choices even the one
previously scheduled.
Here are the erros
Enter Parameter Value
Forms!sbfjncCleaning!cbojoblocautonum
Enter Parameter Value
Forms!sbfjncCleaning!txtdateassigned
I checked all the names of the forms and text boxes and they all match up
not sure since a subform if I need something extra????
Also have a feeling something not right with the syntax??? See below
Private Sub cbojoblocautonum_AfterUpdate()
Dim lsql
'This function set the rowsource of JoblocAutonum,getting rid of what has
already been assigned for a given day
lsql = "Select joblocautonum, job, location, room " & "FROM tbljobsatlocnew
" & "WHERE joblocAutonum NOT IN (Select joblocautonum from tbljnccleaning
where [joblocautonum] = forms!sbfjnccleaning!cbojoblocautonum and
[dateassigned] = forms!sbfjnccleaning!txtdateassigned)"
Me.cbojoblocautonum.RowSource = lsql
End Sub
Need to get this done soon if possible - Thanks in advance for the help,
Barb
- who is the employee and subform shows what many jobs the boss is assigning
them.
For the bosses sake I would like the joblocautnum to list ALL JObs at the
given locations that have NOT yet been assigned for that given Date. Thought
I would create an after update event for the next record- Not sure if this is
the correct place to put it - and somewhere else??? that would include all
jobs at the location but NOT the ones already assigned for that day.
I am sure I am messing up on the syntax somewhere.
I get the drop down and select the joblocautonum for the first record in the
subform fine when I go to the next record in the subform to assign the next
job and hoping that the one I just assigned for that day is not available - I
get two errors and then see the drop down list WITH ALL choices even the one
previously scheduled.
Here are the erros
Enter Parameter Value
Forms!sbfjncCleaning!cbojoblocautonum
Enter Parameter Value
Forms!sbfjncCleaning!txtdateassigned
I checked all the names of the forms and text boxes and they all match up
not sure since a subform if I need something extra????
Also have a feeling something not right with the syntax??? See below
Private Sub cbojoblocautonum_AfterUpdate()
Dim lsql
'This function set the rowsource of JoblocAutonum,getting rid of what has
already been assigned for a given day
lsql = "Select joblocautonum, job, location, room " & "FROM tbljobsatlocnew
" & "WHERE joblocAutonum NOT IN (Select joblocautonum from tbljnccleaning
where [joblocautonum] = forms!sbfjnccleaning!cbojoblocautonum and
[dateassigned] = forms!sbfjnccleaning!txtdateassigned)"
Me.cbojoblocautonum.RowSource = lsql
End Sub
Need to get this done soon if possible - Thanks in advance for the help,
Barb