Forums - Simple Question

eholtman

Registered User.
Local time
Today, 11:26
Joined
Oct 12, 2004
Messages
54
I have started working on a Access project and have all tables completed. One issue that I am running into is on my forms I want to create IF statments. I am very familar with Excel expressions But are having issues with creating in Access where the statments go?

Example.

Requester pull down.. (X)
Phone Numer (I need the phone number to automaticly pulled or entered) if requester = x.)

I know this will be a simple thing. But I promise you I have been looking and everything I have tried is not working.

Thanks
 
eholtman,

Hard to see what you need to do, but you can try some things
to get you started.

You can use the AfterUpdate event of the Requester combo to put
this code:

Code:
If Me.Requester = "x" Then
   Me.PhoneNumber.Visible = True
   Me.PhoneNumber.Enabled = True
   Me.PhoneNumber.SetFocus
Else
   Me.PhoneNumber.Visible = False
   Me.PhoneNumber.Enabled = False
End If

Wayne
 
I'm going to go out on a limb and assume that eholtman is in the beginning stages of becoming familiar with Access, am I right? Just a hunch...

If so, then I suggest you tell us more about your table structure (especially if it's coming in from Excel, it's probably 'flattened' and needs some work), eholtman, and we can help you with queries and, more directly with your question, forms which will allow for droplists and combo boxes and automated fun like phone numbers popping up as you mentioned.

If I'm wrong, then whoops!, sorry!, and WayneRyan is light years ahead of me anyway, so eholtman is in good hands.
 
Sorry for being vague.

I am not familar with VB tool. Using Microsoft Visual Basic.

In my form I have pull downs and open text boxes.

Basically what I am trying to do is

Requester - x (This is a pull down)

Phone number - (This would tie into the Requester that was selected)


I want it to input the phone number that pertains to the pull down.

If this is code then where does it go? Is that in the event of VB.

Monkey I am familar with Access but not macro or VB. Give me someone elses database I can follow through. So this is my first project starting from scratch. Like I said it is easy in excel with If statments. But I am not sure where they go.
 
Last edited:
Again, without an idea of your table structure, it's difficult to give you advice. I've got a feeling that what you want is something like the following:

-- You are keeping a list of projects, stored in a table (tblProjects). Each project has a Requestor, all of whom are stored in a table (tblRequestors), and you want to be able to choose a Requestor from a dropdown list to apply to a project. When the Requestor for a project is chosen, you want to see that Requestor's details. --

Is that more or less correct? If that's the case, it should be as simple as using the dropdown wizard in your Forms toolbox, building it based on your table of Requestors (tblRequestors), and providing your relationships and query are solid, any appropriate text-boxes (based on your query) will populate themselves if the data exists. The dropdown wizard will give you choices on storing data from the Requestors table in a field on your form (i.e. the Primary Key of tblRequestor for your Foreign Key of your join table, tblProjectRequestors)
 

Users who are viewing this thread

Back
Top Bottom