By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,777 Members | 1,311 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,777 IT Pros & Developers. It's quick & easy.

function to stop certain dates being entered twice in access form

P: n/a
i am posting this message again in an attempt to solicit more
responses.
i want to add a function that will NOT allow the form to be ran if the
dates entered in the dlgdates box have already been ran. essentially i
want an "end if" function for dates previously entered. is there anyone
who can help me with this issue?

the form includes a dlgdates box for both "start date" and "end date".
the form runs the queries, which appends the results to tables based on
each query.

the code for the current form is:
Private Sub cmdCalcCumBM_Click()
On Error GoTo Err_cmdCalcCumBm_Click
DoCmd.SetWarnings False
CalcCum "qryCalcCumYTDBM"
DoCmd.OpenQuery "qryYTDReturnsBM", acNormal, acEdit
CalcCum "qryCalcCumQBM"
DoCmd.OpenQuery "qryQReturnsBM", acNormal, acEdit
CalcCum "qryCalcCum6mBM"
DoCmd.OpenQuery "qry6MReturnsBM", acNormal, acEdit
CalcCum "qryCalcCum12mBM"
DoCmd.OpenQuery "qry12MReturnsBM", acNormal, acEdit
CalcCum "qryCalcCumCumBM"
DoCmd.OpenQuery "qryCumReturnsBM", acNormal, acEdit
CalcCum "qryCalcCum24mBM"
DoCmd.OpenQuery "qry24MReturnsBM", acNormal, acEdit
MsgBox "All Calculations Completed"
DoCmd.SetWarnings True
Me.Visible = False
Exit_cmdCalcCumBM_Click:
Exit Sub
Err_cmdCalcCumBm_Click:
MsgBox Err.Description
Resume Exit_cmdCalcCumBM_Click
End Sub
it has been suggested that i run a dlookup function, but it didn't work
correctly, probably due to my own error. what would a proper function
look like and where would i place it in the code? i apologize for my
access ignorance.

Nov 13 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a


js*******@gmail.com wrote:
i am posting this message again in an attempt to solicit more
responses.


Hm. http://www.mvps.org/access/netiquette.htm is reading material.
--
Bas Cost Budde, Holland
http://www.heuveltop.nl/BasCB/msac_index.html

Nov 13 '05 #2

P: n/a
js*******@gmail.com wrote:
i am posting this message again in an attempt to solicit more
responses.


How extremely impolite and inconsiderate.
--
Tim http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "Whatcha doin?" - Ditto "TIM-MAY!!" - Me
Nov 13 '05 #3

P: n/a
Tim Marshall wrote:
js*******@gmail.com wrote:
i am posting this message again in an attempt to solicit more
responses.

How extremely impolite and inconsiderate.


But honest! At least.

--
Bas Cost Budde, Holland
http://www.heuveltop.nl/BasCB/msac_index.html

Nov 13 '05 #4

P: n/a
Bas Cost Budde wrote:
Tim Marshall wrote:
js*******@gmail.com wrote:
i am posting this message again in an attempt to solicit more
responses.
How extremely impolite and inconsiderate.

But honest! At least.


That's true. 8)

--
Tim http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "Whatcha doin?" - Ditto "TIM-MAY!!" - Me
Nov 13 '05 #5

P: n/a
jv
How will you know if a date has been entered? Are previous dates
stored in a table somewhere? What is that table name and what is the
field name?
Sample dlookup code:
x=dlookup("FieldName","TableName","Criteria")

Dlookup returns a variant that will contain the value of the specified
field it a match is found or it will return a null value if a match is
not found. You can read more about dlookup from Access Visual Basic
Help (open any module then press F1, then search for dlookup).

Good Luck

Nov 13 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.