View Single Post
  #7  
Old October 2nd, 2006, 11:50 PM posted to microsoft.public.access.forms
Douglas J. Steele
external usenet poster
 
Posts: 9,313
Default Double Click to add

By itself, that "GotoNew" does absolutely nothing. All you're doing is
passing a string as an argument to the form you're opening up. You need to
do something in the form that's being opened to read that argument, and take
some action.

In the Load event of form "Shipping Methods", put code like:

Private Sub Form_Load()
If IsNull(Me.OpenArgs) = False Then
If Me.OpenArgs = "GoToNew" Then
DoCmd.GoToRecord acDataForm, Me.Name, acNewRec
End If
End If
End Sub


--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)


"DawnTreader" wrote in message
...
Hello

hopefully someone can help on this problem that I am having that is
related
to this.

when i doubleclick to add a new record to the drop down list, it is not
moving me to a new record spot. why? i have the exact same code, except
for
the field being used, as shown below.

Private Sub ShippingMethodID_NotInList(NewData As String, Response As
Integer)
MsgBox "Double-click this field to add an entry to the list."
Response = acDataErrContinue
End Sub
Private Sub ShippingMethodID_DblClick(Cancel As Integer)
On Error GoTo Err_ShippingMethodID_DblClick
Dim lngShippingMethodID As Long

If IsNull(Me![ShippingMethodID]) Then
Me![ShippingMethodID].Text = ""
Else
lngShippingMethodID = Me![ShippingMethodID]
Me![ShippingMethodID] = Null
End If
DoCmd.OpenForm "Shipping Methods", , , , , acdialog, "GotoNew"
Me![ShippingMethodID].Requery
If lngShippingMethodID 0 Then Me![ShippingMethodID] =
lngShippingMethodID

Exit_ShippingMethodID_DblClick:
Exit Sub

Err_ShippingMethodID_DblClick:
MsgBox Err.Description
Resume Exit_ShippingMethodID_DblClick
End Sub

i am assuming that the problem is something with the command:

DoCmd.OpenForm "Shipping Methods", , , , , acdialog, "GotoNew"

but what? i have the gotonew part on my line, is there another argument or
part to the DoCmd.OpenForm that is used to get it to move the current
record
to a blank one?