P
PHisaw
I'm trying to create a pop-up form to allow users to enter data to table that
main form is based on. Due to size of main form and because pop-up fields
will only be used per certain entries on main form, I want to use a pop-up
form to enter needed data. On the main form, I have the fields listed below.
For example, if user enters "TypeOne" as a PType and then enters Model,
AfterUpdate to Model field a pop-up form opens with fields for UnitGroupName
and UnitModelName. I would like the UnitGroupName to be populated with "All
TypeOne Products" when the pop-up opens and then select UnitModelName from a
combo filtered on entry in UnitGroupName.
Main Form fRepairs
JobNumber (PK)
PType
Model
On AfterUpdate event for model :
Private Sub Model_AfterUpdate()
If Me.PumpType = "TestOne" Then
DoCmd.OpenForm "fGroupInfoForStatusCountCalculated", , , "JobNumber=" &
Me.JobNumber
End If
End Sub
On form "fGroupInfoForStatusCountCalculated":
JobNumber
GroupUnitName
GroupModelName
Private Sub Form_Open(Cancel As Integer)
If Forms!frepairs!PumpType = "TestOne" Then
Me.UnitGroupName = "All TestOne Products"
End If
When I enter a model to the Model field, it throws an error "you can't
assign a value to this object" and on Debug this row is highlighted:
Me.UnitGroupName = "All TestOne Products"
If anyone would please tell me what I'm doing wrong, I would greatly
appreciate it. I also have six PTypes to set up this way. Once I get code
in place, would it be better to use multiple "if" statements or "case select"
statements - I'm never sure which to use in situations like this.
Thanks in advance for any help.
Pam
main form is based on. Due to size of main form and because pop-up fields
will only be used per certain entries on main form, I want to use a pop-up
form to enter needed data. On the main form, I have the fields listed below.
For example, if user enters "TypeOne" as a PType and then enters Model,
AfterUpdate to Model field a pop-up form opens with fields for UnitGroupName
and UnitModelName. I would like the UnitGroupName to be populated with "All
TypeOne Products" when the pop-up opens and then select UnitModelName from a
combo filtered on entry in UnitGroupName.
Main Form fRepairs
JobNumber (PK)
PType
Model
On AfterUpdate event for model :
Private Sub Model_AfterUpdate()
If Me.PumpType = "TestOne" Then
DoCmd.OpenForm "fGroupInfoForStatusCountCalculated", , , "JobNumber=" &
Me.JobNumber
End If
End Sub
On form "fGroupInfoForStatusCountCalculated":
JobNumber
GroupUnitName
GroupModelName
Private Sub Form_Open(Cancel As Integer)
If Forms!frepairs!PumpType = "TestOne" Then
Me.UnitGroupName = "All TestOne Products"
End If
When I enter a model to the Model field, it throws an error "you can't
assign a value to this object" and on Debug this row is highlighted:
Me.UnitGroupName = "All TestOne Products"
If anyone would please tell me what I'm doing wrong, I would greatly
appreciate it. I also have six PTypes to set up this way. Once I get code
in place, would it be better to use multiple "if" statements or "case select"
statements - I'm never sure which to use in situations like this.
Thanks in advance for any help.
Pam