Open in Edit Mode

  • Thread starter Thread starter ServiceEnvoy
  • Start date Start date
S

ServiceEnvoy

I currently have a double click function to open another form by
double clicking a unique id number. Is there a way to set up the
double click to open the other form in "add" mode if there is no
number present in the field? Here is the current double click vba I
have:

Private Sub ServicerID_DblClick(Cancel As Integer)
DoCmd.OpenForm "servicersAll", , , "[ID] = " & Me.[ServicerID] & ""
End Sub
 
ServiceEnvoy said:
I currently have a double click function to open another form by
double clicking a unique id number. Is there a way to set up the
double click to open the other form in "add" mode if there is no
number present in the field? Here is the current double click vba I
have:

Private Sub ServicerID_DblClick(Cancel As Integer)
DoCmd.OpenForm "servicersAll", , , "[ID] = " & Me.[ServicerID] & ""
End Sub

Private Sub ServicerID_DblClick(Cancel As Integer)
Dim DataMode As Integer

DataMode = Iif(Me.ServicerID & "" = "", acFormAdd, acFormEdit)
DoCmd.OpenForm "servicersAll", , , "[ID] = " & Me.[ServicerID] & "",
DataMode
End Sub
 
ServiceEnvoy said:
I currently have a double click function to open another form by
double clicking a unique id number. Is there a way to set up the
double click to open the other form in "add" mode if there is no
number present in the field? Here is the current double click vba I
have:

Private Sub ServicerID_DblClick(Cancel As Integer)
DoCmd.OpenForm "servicersAll", , , "[ID] = " & Me.[ServicerID] & ""
End Sub


If IsNull(Me.ServicerID) Then
DoCmd.OpenForm "servicersAll", , , , acFormAdd
Else
DoCmd.OpenForm "servicersAll", , , "ID=" & Me.ServicerID
End If
 
ServiceEnvoy said:
I currently have a double click function to open another form by
double clicking a unique id number. Is there a way to set up the
double click to open the other form in "add" mode if there is no
number present in the field? Here is the current double click vba I
have:
Private Sub ServicerID_DblClick(Cancel As Integer)
DoCmd.OpenForm "servicersAll", , , "[ID] = " & Me.[ServicerID] & ""
End Sub

If IsNull(Me.ServicerID) Then
DoCmd.OpenForm "servicersAll", , , , acFormAdd
Else
DoCmd.OpenForm "servicersAll", , , "ID=" & Me.ServicerID
End If

Thanks a million. You guys make it look so easy. I'm trying to learn!
 
Back
Top