hi Kelvin,
Never watched such kind of training materials, but looks ok for me.
--
Best regards,
___________
Alex Dybenko (MVP)
http://alexdyb.blogspot.com
http://www.PointLtd.com
"Kelvin Beaton" <kelvin at mccsa dot com> wrote in message
Hi Alex
do you know if this course is any good?
http://www.youlearn.com/products/lk-products/A/access2003dev/access2003dev.html
Do you know of any better sources for these topics?
Thanks
Kelvin
oops, sorry, this was a typo
--
Best regards,
___________
Alex Dybenko (MVP)
http://alexdyb.blogspot.com
http://www.PointLtd.com
"Kelvin Beaton" <kelvin at mccsa dot com> wrote in message
Hi Alex
Thanks for the reply
Turns out it needed quotes around "[ImportDate]"
Thanks
Kelvin
Hi,
put a stop at that line:
ElseIf [ImportDate] > DMax([ImportDate], "qry_PSI_ImportDate_Max")
then go to debug window ctrl+G and type there:
?[ImportDate]
?DMax([ImportDate], "qry_PSI_ImportDate_Max")
you will see the actual values and this will give you an idea what
is going wrong
--
Best regards,
___________
Alex Dybenko (MVP)
http://alexdyb.blogspot.com
http://www.PointLtd.com
"Kelvin Beaton" <kelvin at mccsa dot com> wrote in message
Hi Alex
it seems that no matter what date I put in the message "You have
already imported PSI data for this date" pops up.
I've tried dates before and after...
Below is the complete code.
If both of the first conditions are met, I want it to run the code
after the Else statement.
Can you see what's causing this?
Thanks
Kelvin
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Private Sub Command8_Click()
On Error GoTo Err_Command8_Click
Dim stDocName As String
If IsNull([ImportDate]) Then
MsgBox "You must enter an Import date."
ElseIf [ImportDate] > DMax([ImportDate],
"qry_PSI_ImportDate_Max") Then
MsgBox "You have already imported PSI data for this date"
Else
DoCmd.RunMacro "mac_UpdateMCCSACleanedTable", , ""
DoCmd.OpenQuery "qry_PSI1_DataCleaner", acViewNormal, acEdit
DoCmd.OpenQuery "qry_PSI2_Append_ClientRecords",
acViewNormal, acEdit
DoCmd.SetWarnings False
DoCmd.OpenQuery "qry_PSI3_MakeTable_ContactLog",
acViewNormal, acEdit
DoCmd.OpenQuery "qry_PSI4_Append_ContactLog", acViewNormal,
acEdit
DoCmd.RunMacro "mac_UpdateMCCSACleanedTable", , ""
MsgBox "PSI Data Imported Successfully."
DoCmd.Close
Exit_Command8_Click:
Exit Sub
Err_Command8_Click:
MsgBox Err.Description
Resume Exit_Command8_Click
End If
End Sub
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
message Hi,
you can not reference query that why, instead you have to use some
function:
If IsNull([ImportDate]) Then
MsgBox "You must enter an Import date."
Elseif [ImportDate] >
dmax("ImportDate","qry_PSI_ImportDate_Max") then
msgbox "bla-bla"
end if
--
Best regards,
___________
Alex Dybenko (MVP)
http://alexdyb.blogspot.com
http://www.PointLtd.com
"Kelvin Beaton" <kelvin at mccsa dot com> wrote in message
I'm trying to check for two things here.
One that there's an import date, that part work.
Two I want to make sure the date entered is greater then the date
entered.
But it doesn't like the ">" greater then sign.
I've tried this,
[Query]![qry_PSI_ImportDate_Max]![ImportDate]
and this
(>[Query]![qry_PSI_ImportDate_Max]![ImportDate])
and this
([Query]![qry_PSI_ImportDate_Max]![ImportDate])
with no luck.
This code works fine without the OR statement.
----------------------------
Private Sub Command8_Click()
On Error GoTo Err_Command8_Click
Dim stDocName As String
If IsNull([ImportDate]) Then
MsgBox "You must enter an Import date."
Else
----------------------------
How do I get it to look for greater than?
Can someone point me in the right direction?
What am I doing wrong?
Thanks
Kelvin