Link to home
Start Free TrialLog in
Avatar of c9k9h
c9k9h

asked on

INSERT INTO With DMAX Function (Teradata backend)

I have an access DB that I have recently moved to a Teradata environment. Teradata, however, does not allow an auto number to be generated so I've had to manually create an auto ID. The one I have (which works is as follows:frmMedRecords.RequestID = DMax("RequestId", "[Medical Records Requests]") + 1

However, I have an INSERT INTO function from another form/table that I want to implement the DMAX into. I've been playing around with the code, this is what I have so far, it does not work.
Any help is greatly appreciated.
Thanks so much!
CurrentDb.Execute ("INSERT INTO [Medical Records Requests] (LastName, FirstName, [Claim Num], PendingOrActive, RequestID) VALUES ('" & Me.txtLast & "','" & Me.txtFirst & "','" & Me.pendclaimnum & "','" & Me.Status & "','" & frmMedRecords.RequestID = DMax("RequestId", "[Medical Records Requests]") + 1 & "' )")

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of c9k9h
c9k9h

ASKER

Works Perfect! Thank you so much!!!
Avatar of c9k9h

ASKER

150% accurate first response!