Going to specific record on form, and form field dependent on another field.....

kaisersose

Registered User.
Local time
Yesterday, 23:47
Joined
Sep 25, 2008
Messages
13
I have a database set up with a main menu, and on the main menu have buttons that bring you to various forms. One of these is a button to an administrator section form. This admin section allows the person to go through all the records and make updates if they want.

All the records are saved in a table called Data
They each have an ID field.

What I want to happen, is when the user clicks on the administrator button, the are prompted to enter the ID of the record they want to go to. If they enter an ID that is not on the table, they would be told that this ID does not exist and they would stay on the main menu.

Is this possible?


Second Question:
I have a form with 2 drop down lists. One is called "Code" and the order is called "Problem".

The source of these drop down lists is a table called Issues which has a field called Code and a field called Problem. And this fields contain the information I want listed in the drop down lists.

What I want to happen on the form is, when the user picks the Code in the drop down list it automatically updates the Problem field straight away (not after the record is submitted). Like for example when you see forms where it has coutries and states, and depending on what country the user select, you get a different list of states.

Anyone have examples of this?
 
What I want to happen, is when the user clicks on the administrator button, the are prompted to enter the ID of the record they want to go to.

Look in Access help, search for OpenForm methode.

If they enter an ID that is not on the table, they would be told that this ID does not exist and they would stay on the main menu.

You can use Dcount function prior to open form to determend if the record exist, if it dosen't exist display a messagebox and cancel the formOpenEvent.

Code:
If (Dcount("*", "Data", "[id] =" & [prompt Id]) >0) Then
 ' Open form filtered on ID
 Else
  Msgbox "ID exist in Table"
End If

Like for example when you see forms where it has coutries and states, and depending on what country the user select, you get a different list of states.

This is called Cascading combo/listbox, there are lot's of way to do this. Here is a couple: http://www.access-programmers.co.uk/forums/search.php?searchid=6221389

Hope this get's you going.

JR
 

Users who are viewing this thread

Back
Top Bottom