Link Criteria to another form

  • Thread starter Thread starter Lee
  • Start date Start date
L

Lee

Hello everyone,
I'm not sure how to do the following and hope you can help
me with this:
I have a listbox on a form that lists when exports of data
have been undertaken. The users may click on one on the
exports within the listbox and (via a command button), the
details of all the records within the export will be opened
to view in another form. The bound column of the listbox
is the Export Date/Time. As a number of processes are
undertaken when exporting, the date/time shown in the
listbox may not exactly match the date/time that is
appended to each exported record - on my PC here at home,
there's occasionally just a one second difference but I'm
sure that when it runs via a network there will be a
greater disparity. Because the date/time doesn't exactly
match, the opened form does NOT display the records that
comprised the selected export.

What I'd like to do is allow for some leeway when matching
the two date/times when opening the (linked) form - say 15
seconds either way. How do I express this in vb? (eg
pseudo code: stLinkCriteria = ExportDate + or - 15 seconds)

I guess I could allocate an export number instead of using
the date/time but I don't know how to do this either!
Create another table that has an autonumber field in it?

Any help would really appreciated.

Lee
 
Try

StrLinkCriteria = "[ExportDateField] Between #" & _
DateAdd("s", -15, ExportDate) & "# And #" & _
DateAdd("s", 15, ExportDate) & "#"
 
Thanks Ken,
That's just the job!!
Regards,

Lee
-----Original Message-----
Try

StrLinkCriteria = "[ExportDateField] Between #" & _
DateAdd("s", -15, ExportDate) & "# And #" & _
DateAdd("s", 15, ExportDate) & "#"


--
Ken Snell
<MS ACCESS MVP>

Hello everyone,
I'm not sure how to do the following and hope you can help
me with this:
I have a listbox on a form that lists when exports of data
have been undertaken. The users may click on one on the
exports within the listbox and (via a command button), the
details of all the records within the export will be opened
to view in another form. The bound column of the listbox
is the Export Date/Time. As a number of processes are
undertaken when exporting, the date/time shown in the
listbox may not exactly match the date/time that is
appended to each exported record - on my PC here at home,
there's occasionally just a one second difference but I'm
sure that when it runs via a network there will be a
greater disparity. Because the date/time doesn't exactly
match, the opened form does NOT display the records that
comprised the selected export.

What I'd like to do is allow for some leeway when matching
the two date/times when opening the (linked) form - say 15
seconds either way. How do I express this in vb? (eg
pseudo code: stLinkCriteria = ExportDate + or - 15 seconds)

I guess I could allocate an export number instead of using
the date/time but I don't know how to do this either!
Create another table that has an autonumber field in it?

Any help would really appreciated.

Lee


.
 
Back
Top