programming text within a form

  • Thread starter Thread starter Emily V.
  • Start date Start date
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
 
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
 
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!
 
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
 
Back
Top