Msg Box Macro

G

Guest

I am using a message box Macro in designing a database to keep track of
incoming shipments. We check every 10th part we receive to make sure that
it passes inspection. So every tenth peice of data I need the msg box macro
to appear and ask if the part has passed inspection. If the answer is yes
than it will return to the original form. If the answer is no I need to know
how to send it to another database recording all of the faulty parts we
receive. Any help would be appreciated.
 
S

Steve Schapel

Donbenz,

It will be very difficult to detect "every 10th part" unless it's based
on actual data. Therefore you could add (if you don't already have) an
incrementing number field to the table. Then you could use a Condition
in the macro, something like this...
[NumberID]/10=[NumberID]\10
 
G

Guest

Steve,

I do have an incrementing number field to my table. My other question is on
the msg box what code should i use to say if the no button is clicked I want
my form Check 5 Lot to come up.

Donbenz

Steve Schapel said:
Donbenz,

It will be very difficult to detect "every 10th part" unless it's based
on actual data. Therefore you could add (if you don't already have) an
incrementing number field to the table. Then you could use a Condition
in the macro, something like this...
[NumberID]/10=[NumberID]\10

--
Steve Schapel, Microsoft Access MVP
I am using a message box Macro in designing a database to keep track of
incoming shipments. We check every 10th part we receive to make sure that
it passes inspection. So every tenth peice of data I need the msg box macro
to appear and ask if the part has passed inspection. If the answer is yes
than it will return to the original form. If the answer is no I need to know
how to send it to another database recording all of the faulty parts we
receive. Any help would be appreciated.
 
S

Steve Schapel

Donbenz,

You will need to do this in 2 steps. If I understand you correctly,
your macro might look something like this...

Condition: [NumberID]/10<>[NumberID]\10
Action: StopMacro

Condition: MsgBox("Pass muster?",36)=7
Action: OpenForm
Form Name: Check 5 Lot

By way of explanation, the 36 is comprised of 4 (the code for Yes and No
buttons on a messagebox) plus 32 (the code for a question mark icon on
the message box), and the 7 is the code for a No response.
 

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