I’m in trouble with my Windows 10 / MS Access 2013 data-bank – I’m writing a program to file (many replicate) radio amateur contacts that should be saved each new in a new record…
The problem is that I have a ‘Progressive Search (the one that dynamically searches at each new Call’s letter is entered in a textbox)’ and, when I’m showed that I have already worked that station, I mark the Call’s station in the listbox and click “GetData” to get all the common data to a new Form to file (to add) some more fresh info. My Access is saving, in a new file! ONLY the letters I typed in the ‘Progressive Search’ and, afterwards, when I click the “INSERT” button, it saves in a subsequent file all the data I got from the last contact + the specific ones of the current contact! See the code…
Private Sub btnGetData_Click() ‘ Btn “GetData” Dim rst As Object Set rst = Me.RecordsetClone rst.FindFirst “[ID] = ” & Me.lstStaff.Value If Not rst.EOF Then Me.Bookmark = rst.Bookmark
With Me.lstStaff If IsNull(.Value) Then .Value = .ItemData([ID]) Me.Call.Value = .Column(1) Me.QRA.Value = .Column(2) Me.QTH.Value = .Column(3) End With
Private Sub btnInsert_Click() ‘ Btn “INSERT”
Dim SQL SQL = "INSERT INTO tblStaff (Call,QRA,QTH,RST,QRG,TimeStart,TimeEnd)" & _ "VALUES (Call,QRA,QTH,RST,QRG,TimeStart,TimeEnd)" & "CurrentDb.Execute SQL" DoCmd.RunCommand acCmdSaveRecord DoCmd.GoToRecord , , acNewRec
I’ve been struggling with this problem now for over a week…! What should be done, please, to prevent the ‘Search typed letters’ to be saved… and in a separate file!?
Thanks, beforehand, Enih Gil’ead