B
Bagger
I've got a database I've been working on for the last couple weeks. It's
mostly working pretty well, but I just ran into a problem yesterday that I
can't seem to figure out. I have a main form that the user spends almost all
their time on. It's a tabbed form with several subforms on the various tabs.
Now one of these tabs has a button that pops up another form that allows
them to edit information on a contract. What I'm trying to do is grab a
couple of values from the combo boxes on the main form to pre-populate this
popup form. I suppose I could pass the key fields in and just pull the data
from the table, but I'm just wondering why this won't work, when I've done
basically the same thing in other places and it worked fine. Here's the code
that references the main form controls:
Me.txtContractNumber = [Forms]![frmContractInfo2].[Form]![cmbContract1]
Me.cmbBase = [Forms]![frmContractInfo2].[Form]![cmbBase1]
If Not IsNull(Forms![frmContractInfo2].[Form]![cmbContractType]) Then
Me.cmbContract_Type = _
Forms![frmContractInfo2].[Form]![cmbContractType].Value
End If
Ok, the first 2 lines work just fine. The error always occurs on the line
inside the If statement. The error is "Run-time error '2424': The expression
you entered has a field, control, or property name that Microsoft Office
can't find." I've triple-checked the form and control names.. several times
now, so those are right. It's strange to me that it doesn't bomb out on the
check in the If statement, but does on the line after that.
Anyone have any idea what would cause this?
mostly working pretty well, but I just ran into a problem yesterday that I
can't seem to figure out. I have a main form that the user spends almost all
their time on. It's a tabbed form with several subforms on the various tabs.
Now one of these tabs has a button that pops up another form that allows
them to edit information on a contract. What I'm trying to do is grab a
couple of values from the combo boxes on the main form to pre-populate this
popup form. I suppose I could pass the key fields in and just pull the data
from the table, but I'm just wondering why this won't work, when I've done
basically the same thing in other places and it worked fine. Here's the code
that references the main form controls:
Me.txtContractNumber = [Forms]![frmContractInfo2].[Form]![cmbContract1]
Me.cmbBase = [Forms]![frmContractInfo2].[Form]![cmbBase1]
If Not IsNull(Forms![frmContractInfo2].[Form]![cmbContractType]) Then
Me.cmbContract_Type = _
Forms![frmContractInfo2].[Form]![cmbContractType].Value
End If
Ok, the first 2 lines work just fine. The error always occurs on the line
inside the If statement. The error is "Run-time error '2424': The expression
you entered has a field, control, or property name that Microsoft Office
can't find." I've triple-checked the form and control names.. several times
now, so those are right. It's strange to me that it doesn't bomb out on the
check in the If statement, but does on the line after that.
Anyone have any idea what would cause this?