Message Box Warning in Form

  • Thread starter Thread starter Steve Stad
  • Start date Start date
S

Steve Stad

I would like to have a message box display a message if the user changes the
value of a field to any value not in a specified list, e.g., specified list
is (Redskins, Cowboys, Ravens). e.g., on event 'before update' display
message if Team is changing from 'Redskins' to 'Raiders' because 'Raiders' is
not in list. Is there an easy way to do this. I am not a programmer but
could use a simple snippet if provided. Thanks
 
Steve

If you are using a combobox to list the valid values, you can set the
LimitToList property to Yes for that combobox (in form design view).

Regards

Jeff Boyce
Microsoft Access MVP

--
Disclaimer: This author may have received products and services mentioned
in this post. Mention and/or description of a product or service herein
does not constitute endorsement thereof.

Any code or pseudocode included in this post is offered "as is", with no
guarantee as to suitability.

You can thank the FTC of the USA for making this disclaimer
possible/necessary.
 
Jeff - Imagine a Master database w/Master table of all NFL players. The team
field for each player in the Master table is based on a combo box of 26
teams. I am making several separate databases that filter the Master table
into four regional divisions, e.g., east, west, central, north. The four
db's and data is separate (i.e., partioned) so the east db can not see
players in the West db. Input for each regional db is controlled by four
separate people. So if a player changes from the Redskins to the Raiders the
player will move to the West db and no longer be seen by the east db. I want
a message to warn the user of the east db that players team changed to a non
eastern team. So they are sure of the change.
 
Steve

Perhaps its a matter of terminology, but when I see "making several separate
databases" I think about several different .mdb (or .accdb) files. Are you
referring to several separate tables (Access terminology), each of which
contains your "regional divisions" data?

If so, you may be committing spreadsheet on Access.

In a well-normalized relational database (Access) you would need a table to
store teams, with a field to show division. Then you'd want a table that
stored players only (name, rank, serial number). Finally, you'd use a
junction table to show which player was connected with which team (and I'm
guessing a couple of date/time fields to show when PlayerX started with
TeamA, and when that player left TeamA).

Or have I read too much into your description?

Regards

Jeff Boyce
Microsoft Access MVP

--
Disclaimer: This author may have received products and services mentioned
in this post. Mention and/or description of a product or service herein
does not constitute endorsement thereof.

Any code or pseudocode included in this post is offered "as is", with no
guarantee as to suitability.

You can thank the FTC of the USA for making this disclaimer
possible/necessary.
 
Jeff,

The reason for the different db's is for security. Each db is in a separate
folder so access to the db's (east, west, etc) can be controlled by access to
the folders (east west, etc) by the Windows OS. We do not want the East User
to see the data in the West user db. So when the east user changes a players
team to a west conference team I wanted a message box to warn the user the
change will move the player out of the eastern conference and will not be
visible to the eastern user(s). All of the data for all regions is in the
master table which is currently linked (and hidden) in the regional db's. I
know it is a simple way to do db security. We may decide to make separate
regional tables and link four regional tables to the master db and union the
tables together in the master table. That is a design decision. I just
wanted the code snippet for an 'if / then' message box warning the user the
players team is changing to a team outside of the east division and will no
longer be visible to the East db user.
 
Hopefully one of the other newsgroup readers has done something like this
and can help.

I don't have any experience with this design model...

Good luck!

Regards

Jeff Boyce
Microsoft Access MVP

--
Disclaimer: This author may have received products and services mentioned
in this post. Mention and/or description of a product or service herein
does not constitute endorsement thereof.

Any code or pseudocode included in this post is offered "as is", with no
guarantee as to suitability.

You can thank the FTC of the USA for making this disclaimer
possible/necessary.
 
Back
Top