Hello everybody,
I am sure that most of you had to answer more than once to this problem, but as a newbie after spending a couple of days trying on my own to make a simple application, i have to kneel and ask for your help.
I have a table with 2 fields a name (text) and a serial (number).
All i want to do is to make a form to help me enter the data into my table and to print it.
I managed to do something but i am stuck with this situation ...
I created a button in my form to do all above (save a record and to print it through a report) with the following code :
Private Sub Command16_Click()
Dim strWhere As String
If Me.Dirty Then
Me.Dirty = False
End If
If Me.NewRecord Then 'Check there is a record to print
MsgBox "bla bla"
Else
strWhere = "[ID] = " & Me.[ID]
DoCmd.GoToRecord , , acNewRec
DoCmd.OpenReport "Print_current", acViewPreview, , strWhere
'DoCmd.RunCommand acCmdRefresh
End If
End Sub
The problem that i have is that if i start this application (with a blank database), all goes as intended ... but if i exit the application and i re-enter, the forms are filled with the last record and if i am trying to make new records, this "last" record is modified with one that i enter after i re-open the application ... and so i am loosing a record each time i re-open the application.
Please do this poor guy a favor and throw him a helping hand !
Thank you in advance !