Another Message Box Question

  • Thread starter Terry DeJournett
  • Start date
T

Terry DeJournett

I have a form with 10 command buttons on it. Each button runs a specific
query and then prints labels. Ex: Button 1 prints labels for Item 1, Button
2 prints labels for Item2, etc. VERY SIMPLIFIED user interface. To be used
in a production facility with a touchscreen monitor, thus no keyboard for
data entry, etc.

I have now created a custom msgbox that pops up when the user presses on of
the command buttons on the main form. This custom msgbox has two buttons on
it Yes and No. No cancels everything and returns back to the main menu.
Yes continues to run the queries and prints the labels.

Is it possible to have a display showing what is being printed. For
example, when user pushed command button 1 on main form to print item #1, a
message shows up on my newly created msgbox (a form in dialog mode) that not
only has the yes or no buttons on it, but a message that says something like
"You have selecte Item 1 To Print. Do you wish to continue?"

Anyone done anything like, or can someone guide me in the right direction?

Thanks,
Terry
 
S

Steve Schapel

Terry,

Yu can put a Label control on the message box form, and then manipulate
its Caption property in code when your command buttons are pressed. For
example...
DoCmd.OpenForm "MessageBox"
Forms!MessageBox!YourLabel.Caption = "Whatever you want"
 
T

Terry DeJournett

Thanks, but the problem I have is the products change on a daily basis.
When the query is run form Command Button 1, it runs query 1 and this query
could return "Product 1" today, but tomorrow the query could return "Product
8". It is this product name that I need to have displayed.

Thanks,
Terry
 
D

Douglas J. Steele

What causes the product to change? Just because Steve's example has a
literal caption doesn't mean that you can't alter it to include values from
variables or controls on the form.

Forms!MessageBox!YourLabel.Caption = "This message is written on " &
Format(Date, "mmmm, dd")
 
T

TD

Thanks to everyone for replying. What actually happens is the production
manager will schedule 10 items to be produced the next day. It would be
easy enough for the end user to enter the product code number for each label
to be printed, but we are trying to use a touch screen monitor and keep the
production workers from entering anything. Just push a button. There are
hundreds of items that 'could' be produced, but only 10 different ones are
produced each day. And never in the same order. That is why I have a form
with 10 buttons. Each button is associated with a query to select the label
for that line for that day.

So what I am trying to do is have a custom msgbox (created from a dialog
form) come up and say....."You are about to print "XXX" labels. Then I have
two big buttons, "Yes" and "No" so the user can continue and print the
labels or cancel the print altogether. I have everyting working except to
be able to change the name "XXX" of the lables in the message. Again the
name will change from day to day and from button to button, depending on the
schedule and queries that are run pulling this info.
I'm just PLAIN stumped.

Again, thanks to everyone making suggestions. I appreciate it.

Terry
 
S

Steve Schapel

Terry,

Let's say the first button is pressed... How does the database "know"
which item to print labels for? You said "I have everyting working
except...", so I assume this means that you have got it set up so that
each button "knows" which labels it is associated with for any given
day, right? So, wherever that information comes from, I imagine you
could use the same source to adjust your message on the form. I mean,
somehow or other, this process needs to be data-driven, but at this
stage can't be specific because I don't know how the data fits together.
So, if the user presses the 'Yes' button on the Message Form, what
exactly happens then to determine which labels get printed?
 
T

TD

Hello Steve: Thanks for helping me. What happens when you press the yes
button, is that a report is opened for the label (all the labels are the
same format) and this label report is based on a query. The query is run
against a table and pulls only 1 record (for the current date), but as many
fields as are to be produced. Once again, someone enters this information
the day before into the table. It may be 5 fields that have info in them
or it may be 10 fields, depending on production schedules.

I know I am making this very complicated and it would be so easy to set up
for the average Access user that had a keyboard in front of them, but the
touchscreen monitor has to be kept as Over Simplified as possible for the
workers on the production line to use. It's a food processing line, cold
temperatures, gloves, etc. so I am making the screen with great big push
buttons to accomplish their printing needs. The labels are food ingredient
labels.

Thanks again for looking at my problem.

T
 
S

Steve Schapel

Terry,

Your idea of using touch screen technology for the operators to trigger
the printing of the labels is superb.

Ok, so apparently you have a query which returns the daily labels
requirements. And each label for the day is in a separate field in this
query. Well (leaving aside the table design aspect, which probably
could be improved here), let's just make this query as the Record Source
of your form, the one with the 1-10 command buttons, (as well as being
the Record Source of the labels report). Ok? And, suppose that the
name of the field in the query that is for the first labels is called
FirstLabels... you will know what it's really named. Ok, so then when
the first button is pushed, you can use code like this...
DoCmd.OpenForm "MessageBox"
Forms!MessageBox!YourLabel.Caption = "Do you want to print " &
Me.FirstLabels & " labels?"

If you still need more help with this, can you give us some more
details, with specific examples, as to the query that the report is
based on, and the code that currently runs to print the labels? Thanks.
 
T

TD

Steve: Thanks for all your suggestions. I tried this and it seems to work.
The only problem I am now having is that because this form is based on a
query, I keep getting a database lock error message and the code freezes and
won't allow me to print the labels. But it does display the correct info on
the custom msgbox.

Thanks,
Terry
 

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