R
Rudi
Hi
How do I query data in a table from within a form using a VB command? I want
to search for a record that has a specific date and name in a table and
then moves to this reocrd in the form so that I can basically edit the
information for that specific record.
Someone (Dennis) already help me, but for some unexplained reason his
techinique doesn't work 100% (Even though it should).
He told me to do the following:
TempID = DLookup("ID", "Timesheet", "[Names] = '" & CurrentUser() & "' And
[Date] = #" & mDate & "#")
DoCmd.GoToControl Forms!Timesheet!Field.ID
DoCmd.FindRecord TempID, acEntire, , acSearchAll, , acCurrent, True
My table and form has the name of "Timesheet". It looks up a unique ID for a
record that has the "CurrentUser" in the Names field and "mdate" (Which I
enter from the form) in the Date field and assigns this ID to TempID. It then
goes to ID control to ensure that the "FindRecord" command searches in that
field and then it should go to the record that has the value "TempID" in the
ID field.
Is their an easier or other way to do this?
Thanks!
Thanks!
R
How do I query data in a table from within a form using a VB command? I want
to search for a record that has a specific date and name in a table and
then moves to this reocrd in the form so that I can basically edit the
information for that specific record.
Someone (Dennis) already help me, but for some unexplained reason his
techinique doesn't work 100% (Even though it should).
He told me to do the following:
TempID = DLookup("ID", "Timesheet", "[Names] = '" & CurrentUser() & "' And
[Date] = #" & mDate & "#")
DoCmd.GoToControl Forms!Timesheet!Field.ID
DoCmd.FindRecord TempID, acEntire, , acSearchAll, , acCurrent, True
My table and form has the name of "Timesheet". It looks up a unique ID for a
record that has the "CurrentUser" in the Names field and "mdate" (Which I
enter from the form) in the Date field and assigns this ID to TempID. It then
goes to ID control to ensure that the "FindRecord" command searches in that
field and then it should go to the record that has the value "TempID" in the
ID field.
Is their an easier or other way to do this?
Thanks!
Thanks!
R