Record>Date association

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
 
J

Jonathan Parminter

-----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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top