setting text box data to table value??
my problem: I want a text box on a form (that contains a value from a table) to put the value it displays into another table, when a button is clicked
here is an example of the tables:
USERS
UserID
First name
Surname
Address
I want UserID on click to be placed in:
Loans
UserID
I think what I want code wise is something like the following:
Private Sub submit_Click()
On Error GoTo Err_Borrow_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Booksearch"
DoCmd.OpenForm stDocName, , , stLinkCriteria
UserID(in loans table) = (the current value of the text box userID, which is from users table)
Exit_Borrow_Click:
Exit Sub
(Obviously the bits in brackets are the bits I dont know the code for
)
I dont know if I have explained myself very well. I hope someone can help.
my problem: I want a text box on a form (that contains a value from a table) to put the value it displays into another table, when a button is clicked
here is an example of the tables:
USERS
UserID
First name
Surname
Address
I want UserID on click to be placed in:
Loans
UserID
I think what I want code wise is something like the following:
Private Sub submit_Click()
On Error GoTo Err_Borrow_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Booksearch"
DoCmd.OpenForm stDocName, , , stLinkCriteria
UserID(in loans table) = (the current value of the text box userID, which is from users table)
Exit_Borrow_Click:
Exit Sub
(Obviously the bits in brackets are the bits I dont know the code for
I dont know if I have explained myself very well. I hope someone can help.
Last edited: