Hello:
I need help again. I'm adding information to a table using the code below, but I need to revise the code to add new functionality. The new functionality I need to add is this.
When someone chooses a session code, I also need it to add the corresponding date into another field, but the users won't see it. For example, if I have a session code of 0701A, I need it to pull the corresponding start_date from "tbl_sessions" and use it to populate the "First_Session" date through the code.
Here's the code I'm using:
Code:
Private Sub Command12_Click()
Set db = CurrentDb()
Set rst = db.OpenRecordset("tbl_Books", dbOpenDynaset)
'all information in here where "Order#" is a column in your table
rst.AddNew
rst("ISBN") = [ISBN]
rst("Book_Title") = [Book_Title]
rst("Publisher") = [Publisher]
rst("Copyright") = [Copyright]
rst("Edition") = [Edition]
rst("Author") = [Author]
rst("Book_Type") = [Book_Type]
rst("Trial_Software") = [Trial_Software]
rst("Comments") = [Comments]
rst("Last_Update") = Now()
rst.Update
rst.Close
If Err = 0 Then
MsgBox "The ISBN number " & ISBN & " was added successfully."
Else
MsgBox "There was an error processing your request."
End If
[ISBN] = Null
[Book_Title] = Null
[Publisher] = Null
[Copyright] = Null
[Edition] = Null
[Author] = Null
[Book_Type] = "Traditional"
[Trial_Software] = "None"
[Comments] = Null
End Sub
Any help would be appreciated.
Best Regards.