hello, i neeed help badly.my problem is i want to retrieve the record that has just been added.
let say:
step :load RESERVATION form->fill in details->click the save button->load RECEIPT form
as soon as i click the save button, i want the records to be displayed in RECEIPT form.
all this operation happens in a single click.but i dont know how to retrieve it!please help.here is my codings :
With Adodc1
.Refresh
.Recordset.AddNew
.Recordset.Fields("Cust_Contact") = Txt_Contact.Text
.Recordset.Fields("Fac_Type") = Fac_type
.Recordset.Fields("Reserv_Date") = Now()
.Recordset.Fields("Booking_Time") = time
.Recordset.Fields("Cust_Name") = Txt_Name.Text
.Recordset.Update
MsgBox "Records have been successfully saved!", vbOKOnly
End With
End If
End If
Unload Me
Adodc1.RecordSource = (current record that has just been added)//i don't know how!
Adodc1.Recordset.Requery
Adodc1.Refresh
Receipt.Lbl_Amount.Caption = amount
Receipt.Lbl_ReservNo = Adodc1.Recordset.Fields("Reserv_No").Value
Receipt.Lbl_Name.Caption = Adodc1.Recordset.Fields("Cust_Name").Value
Receipt.Lbl_DateOfBooking.Caption = Adodc1.Recordset.Fields("Reserv_Date").Value
Receipt.Lbl_FacType.Caption = Adodc1.Recordset.Fields("Fac_Type").Value
Receipt.Lbl_DateIssued.Caption = Now()
Receipt.Lbl_CurrentUser.Caption = current_user
Receipt.Show
End Sub