Help needed with tabular forms

  • Thread starter Thread starter DM
  • Start date Start date
D

DM

Guest
Hi. I need some serious help!

I'm using a tabular form to store customer detailos on a caller ID-type database in Access 97.

As the phone numbers enter, all information on the customer is displayed, and, if the customer is taken on, embedded SQL is used to transfer the information to the relevant tables for permanent storage.

The code I'm using is as follows:

currentRecord = Rec.Bookmark
DestFrom = Rec![Destination From]
DestTo = Rec![Detination To]
AccountType = Rec!Account
PaymentType = Rec![Payment Type]
CustomerNumber = Rec![Client ID]
CarAllocated = Rec![car Allocated]
JobCost = Rec!Cost
JobID = Rec!ID

' Record the job
SQRString = "Insert into Jobs ([Destination From], [Detination To], ClientID, Cost, Account, [Payment Type])" _
& "Values ('" & DestFrom & "','" & DestTo & "'," & CustomerNumber & "," & JobCost & ", '" & AccountType & "','" & PaymentType & "');"

With caller
Set transfer = .CreateQueryDef("", SQRString)
End With
transfer.Execute
<There's quite a bit more, but that's just more variables and SQL>
The problem is, that when the code is run, the record that's inserted is ALWAYS the first record in the form's table. By the very nature of a tabular form, I cannot read the values from the controls directly, and I am now at a loss for what to do. Any help would be greatly appreciated

Thanks
 
Sorry, two small details: Rec is the recordset, and caller is the database
smile.gif
 

Users who are viewing this thread

Back
Top Bottom