Default Value in Form

G

Guest

using Access 2007 Windows XP

I'm attempting to insert a default value in a control on a form
(frmCashrcpt) the control is CURDATE. On the form OnOpen command I have this:

Private Sub Form_Open(Cancel As Integer)

Me!CURDATE.DefaultValue = """" & DLookup = (fairdate!tblfairdate) & """"

End Sub

However, it's telling me that is is a compile error and DLookup is not an
option.

Huh?

Appreciate any help.
 
G

Guest

I changed the statement to read and this works:

Me!CURDATE.DefaultValue = """" & DLookup("fairdate", "tblFairdate") & """"

Now my question, the qryCashRcpts that this form runs on, I need to limit
the information to just the date that is currently the fairdate. How do I
change my criteria to reflect fairdate.tblfairdate on the control Curdate.
mind you there is no relationship between these two tables.
 
G

Guest

Maybe you could use a form filter.
If you place a button on your form you code place some code behind it like:

me.filter=me.curdate
me.filteron=true

hth
 

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