Record>Date association

  • Thread starter Thread starter K Crofts
  • Start date Start date
K

K Crofts

Hi, i have posted this previously but maybe did not
explain myself well enough to receive any help.
I have a calender control on my form, when a date is
selected on it it puts this date into a text box
(''Date'').
I need to be able to click on a date on the calender and
bring up the relevant record for that date (i thought the
addition of the text box would make coding easier), if no
record exists i need a new one to be created.
Any help at all would be appreciated.
Ta
 
-----Original Message-----
Hi, i have posted this previously but maybe did not
explain myself well enough to receive any help.
I have a calender control on my form, when a date is
selected on it it puts this date into a text box
(''Date'').
I need to be able to click on a date on the calender and
bring up the relevant record for that date (i thought the
addition of the text box would make coding easier), if no
record exists i need a new one to be created.
Any help at all would be appreciated.
Ta

.
Hi K Crofts,
seems to me that you want to automate the find record
process....

dim strDate as string
dim strCriteria as string
dim rst as dao.recordset

'format for those of us outside usa
strDate="#" & format(txtdate,"m/d/yy") & "#"
strcriteria="(fieldName)=" & strdate

set rst=me.recordsetclone
rst.findfirst strcriteria

if rst.nomatch then
DoCmd.GoToRecord , , acNewRec
else
me.bookmark=rst.bookmark
end if

set rst=nothing

luck
Jonathan
 
Back
Top