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

If Statement

P: n/a
N J
Hi,

I am using the following code...

I want access to check to see if field 'despatched' is already TRUE, if it
is true then I would like a msgbox to popup saying 'already despatched' then
2 command buttons, one to cancel and not overwrite the details, the other to
continue and overwrite old details with new ones.

Thanks you....

Dim strsql As String

CurrentDb.Execute "Update tblDownload Set DESPATCHED = True, TRACKING = """
& Me.txtTracking & """, DESPDATE = """ & Me.txtDate & """, TODAYDATE = """ &
Me.txtTodayDate & """, Courier = """ & Me.cmbDeliveryMethod & """ Where ID =
" & Me.txtOrderNumber & ";", dbfailonerror
Me.StatusListBox.AddItem "ORDER # " & Me.txtOrderNumber & " DESPATCHED AND
ALLOCATED TRACKING #" & Me.txtTracking & "", 0
txtOrderNumber.SetFocus

--

Kind Regards,
Customer Services
P.S. For us to answer your emails efficiently, please always include the
original message. Thank you.
Nov 13 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a
"N J" <bl*************@blueyonder.co.uk> wrote in message
news:8V***************@fe1.news.blueyonder.co.uk.. .
Hi,

I am using the following code...

I want access to check to see if field 'despatched' is already TRUE, if it
is true then I would like a msgbox to popup saying 'already despatched'
then 2 command buttons, one to cancel and not overwrite the details, the
other to continue and overwrite old details with new ones.

Where are you testing the field contents, on a form? Is the field boolean?
If so, something like this attached to the form's Before Update event will
do:

If Me.chkMyCheckBox Then
If(MsgBox "This will overwrite existing data - continue?", vbYesNo,
"Confirm change") = vbNo Then
Cancel = True
Exit Sub
End If

HTH - Keith.
www.keithwilby.com
Nov 13 '05 #2

P: n/a
"N J" <bl*************@blueyonder.co.uk> wrote in message
news:8V***************@fe1.news.blueyonder.co.uk.. .
Hi,

I am using the following code...

I want access to check to see if field 'despatched' is already TRUE, if it
is true then I would like a msgbox to popup saying 'already despatched'
then 2 command buttons, one to cancel and not overwrite the details, the
other to continue and overwrite old details with new ones.

Where are you testing the field contents, on a form? Is the field boolean?
If so, something like this attached to the form's Before Update event will
do:

If Me.chkMyCheckBox Then
If(MsgBox "This will overwrite existing data - continue?", vbYesNo,
"Confirm change") = vbNo Then
Cancel = True
Exit Sub
End If

HTH - Keith.
www.keithwilby.com
Nov 13 '05 #3

P: n/a
N J
Hi Keith,

Thanks, The field contents are actually in a table, so chkMyCheckBox does
not exist. The field is Boolean.

Thanx.

--

Kind Regards,
Customer Services
P.S. For us to answer your emails efficiently, please always include the
original message. Thank you.
"Keith" <ke*********@baeAWAYWITHITsystems.com> wrote in message
news:42**********@glkas0286.greenlnk.net...
"N J" <bl*************@blueyonder.co.uk> wrote in message
news:8V***************@fe1.news.blueyonder.co.uk.. .
Hi,

I am using the following code...

I want access to check to see if field 'despatched' is already TRUE, if
it is true then I would like a msgbox to popup saying 'already
despatched' then 2 command buttons, one to cancel and not overwrite the
details, the other to continue and overwrite old details with new ones.

Where are you testing the field contents, on a form? Is the field
boolean? If so, something like this attached to the form's Before Update
event will do:

If Me.chkMyCheckBox Then
If(MsgBox "This will overwrite existing data - continue?", vbYesNo,
"Confirm change") = vbNo Then
Cancel = True
Exit Sub
End If

HTH - Keith.
www.keithwilby.com

Nov 13 '05 #4

P: n/a
N J
Hi Keith,

Thanks, The field contents are actually in a table, so chkMyCheckBox does
not exist. The field is Boolean.

Thanx.

--

Kind Regards,
Customer Services
P.S. For us to answer your emails efficiently, please always include the
original message. Thank you.
"Keith" <ke*********@baeAWAYWITHITsystems.com> wrote in message
news:42**********@glkas0286.greenlnk.net...
"N J" <bl*************@blueyonder.co.uk> wrote in message
news:8V***************@fe1.news.blueyonder.co.uk.. .
Hi,

I am using the following code...

I want access to check to see if field 'despatched' is already TRUE, if
it is true then I would like a msgbox to popup saying 'already
despatched' then 2 command buttons, one to cancel and not overwrite the
details, the other to continue and overwrite old details with new ones.

Where are you testing the field contents, on a form? Is the field
boolean? If so, something like this attached to the form's Before Update
event will do:

If Me.chkMyCheckBox Then
If(MsgBox "This will overwrite existing data - continue?", vbYesNo,
"Confirm change") = vbNo Then
Cancel = True
Exit Sub
End If

HTH - Keith.
www.keithwilby.com

Nov 13 '05 #5

P: n/a
"N J" <bl*************@blueyonder.co.uk> wrote in message
news:ng***************@fe1.news.blueyonder.co.uk.. .
Hi Keith,

Thanks, The field contents are actually in a table, so chkMyCheckBox does
not exist. The field is Boolean.

I would think that the easiest way would be to include a (hidden) check box
bound to the boolean field on your form and use my code example as a starter
for 10.
Nov 13 '05 #6

P: n/a
"N J" <bl*************@blueyonder.co.uk> wrote in message
news:ng***************@fe1.news.blueyonder.co.uk.. .
Hi Keith,

Thanks, The field contents are actually in a table, so chkMyCheckBox does
not exist. The field is Boolean.

I would think that the easiest way would be to include a (hidden) check box
bound to the boolean field on your form and use my code example as a starter
for 10.
Nov 13 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.