M
Mike Thomas
In Access 2003, I am trying to add a new record in a bound form as follows:
lngKey = Me.txtFRPK
strNewNumber = InputBox("Please Enter Invoice #:", "NEW INV NUMBER")
If Len(Trim(strNewNumber)) > 0 Then
DoCmd.GoToRecord , , acNewRec
Me.Refresh
Me.txt_FRINumber = strNewNumber
Me.txt_DateOpened = Date
Me.txt_FRINumber.SetFocus
MsgBox "Old " & Str(lngKey) & " NEW " & Str(Me.txtFRPK)
End if
This works OK when run as an MDB, but when I convert it to an MDE, the
record is no longer added. The 3 text boxes are updated, changing the
values in the record we were on when the acNewRec was called.
The msgbox is showing the primary key of the current record before and after
the call. It is the same in both cases.
Does anyone know what could be causing this? Is there a more foolproof way
to add a record?
Many thanks,
Mike Thomas
lngKey = Me.txtFRPK
strNewNumber = InputBox("Please Enter Invoice #:", "NEW INV NUMBER")
If Len(Trim(strNewNumber)) > 0 Then
DoCmd.GoToRecord , , acNewRec
Me.Refresh
Me.txt_FRINumber = strNewNumber
Me.txt_DateOpened = Date
Me.txt_FRINumber.SetFocus
MsgBox "Old " & Str(lngKey) & " NEW " & Str(Me.txtFRPK)
End if
This works OK when run as an MDB, but when I convert it to an MDE, the
record is no longer added. The 3 text boxes are updated, changing the
values in the record we were on when the acNewRec was called.
The msgbox is showing the primary key of the current record before and after
the call. It is the same in both cases.
Does anyone know what could be causing this? Is there a more foolproof way
to add a record?
Many thanks,
Mike Thomas