programming text within a form

E

Emily V.

Ok...

I want to use a dropdown list (combo box, etc) to choose a
type of property (retail, industrial, office, etc).

is there a way to create a macro to run when a certain
type is chosen?

For example - choosing between the following:
Industrial
Office
Retail

Click on "Retail" and up comes the "Retail Properties"
form.

Will this require visual basic programming?
Thanks so much!
--Emily V
 
P

PC Datasheet

Put the following code in the AfterUpdate event of the combobox:
Select Case Me!NameOfCombobox.Column(X)
Case "Indusrtial"
DoCmd.OpenForm "Industrial Properties"
Case "Office"
DoCmd.OpenForm "Office Properties"
Case "Retail"
DoCmd.OpenForm "Retail Properties"
End Select

Where X is the combobox column that supplies the names
 
E

Emily V.

Select Case Me!TYPEID.Column(PropertyType
Case "Industrial
DoCmd.OpenForm "frmIndustrialData
Case "Office
DoCmd.OpenForm "frmOfficeData
Case "Retail
DoCmd.OpenForm "frmRetailData
Case "Land
DoCmd.OpenForm "frmLandTypes
Case "Investment
DoCmd.OpenForm "frmInvestmentData
End Selec

I adjusted the code to work with the actual "names" of the fields
For some reason something isn't quite working

It says that it can't find the macro "Select Case Me!TYPEID
ack!
 
P

PC Datasheet

The use of "PropertyType" is wrong! There needs to be an integer inside the
parantheses indicating what column in the row source of the combobox contains
the PropertyType. For example, if the row source is a query that looks like:

PropertyTypeID PropertyType

a 1 goes inside the parantheses. (Access considers the first column as column 0)

Steve
PC Datasheet
 

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