BabyPowder2u
Programmer
I have a form which has a cboPOC field. Through the MS reservations? database I got the procedure to allow entering a new POC in the POC table by DblClicking POC field. This works fine with one caviat: the field name has to be the same as the Control Source. if I change the field name to prefix "cbo" to indicate it is a cbobox, when I "X" the add POC form, I get the error "object doesn't support this property or method". I would like to be able to call the field cboPOC to indicate what it is.
The code for the POC events are:
Private Sub POCID_DblClick(Cancel As Integer)
On Error GoTo Err_POCID_DblClick
Dim lngPOCID As Long
If IsNull(Me![POCID]) Then
Me![POCID].Text = ""
Else
lngPOCID = Me![POCID]
Me![POCID] = Null
End If
DoCmd.OpenForm "frmPOCDblClk", , , , , acDialog, "GotoNew"
Me![POCID].Requery
If lngPOCID <> 0 Then Me![POCID] = lngPOCID
Forms!frmPOC!POCID = Me![POCID]
Exit_POCID_DblClick:
Exit Sub
Err_POCID_DblClick:
MsgBox Err.Description
Resume Exit_POCID_DblClick
End Sub
Private Sub POCID_NotInList(NewData As String, Response As Integer)
MsgBox "Double-click this field to add an entry to the list."
Response = acDataErrContinue
End Sub
the form load for frmPOC is:
Private Sub Form_Load()
If Me.OpenArgs = "GotoNew" And Not IsNull(Me![POCID]) Then
DoCmd.DoMenuItem acFormBar, 3, 0, , acMenuVer70
End If
End Sub
Any help would be appreciated.
Thanks,
T
The code for the POC events are:
Private Sub POCID_DblClick(Cancel As Integer)
On Error GoTo Err_POCID_DblClick
Dim lngPOCID As Long
If IsNull(Me![POCID]) Then
Me![POCID].Text = ""
Else
lngPOCID = Me![POCID]
Me![POCID] = Null
End If
DoCmd.OpenForm "frmPOCDblClk", , , , , acDialog, "GotoNew"
Me![POCID].Requery
If lngPOCID <> 0 Then Me![POCID] = lngPOCID
Forms!frmPOC!POCID = Me![POCID]
Exit_POCID_DblClick:
Exit Sub
Err_POCID_DblClick:
MsgBox Err.Description
Resume Exit_POCID_DblClick
End Sub
Private Sub POCID_NotInList(NewData As String, Response As Integer)
MsgBox "Double-click this field to add an entry to the list."
Response = acDataErrContinue
End Sub
the form load for frmPOC is:
Private Sub Form_Load()
If Me.OpenArgs = "GotoNew" And Not IsNull(Me![POCID]) Then
DoCmd.DoMenuItem acFormBar, 3, 0, , acMenuVer70
End If
End Sub
Any help would be appreciated.
Thanks,
T