So heres what i have so far. I am trying to make a form in which new staff members can enter in their data (emergency cotnact info, ect.) in a form that acts as a program.
The first tab has a place where htey enter thier first name and last name into 2 text boxes and then saves it into a staff table. there are numbers assigned to each staff in that table which are called Staff ID.
The way this form is set up is that a new staff can enter in thier information without having to enter in thier first and last name for each page.
I think i need to assign a global variable, but i am not sure how.
Here is what i have on the general part of the vba code
Option Compare Database
Dim PermanentStaffID As Integer
Dim db As Database
Dim rs As Recordset
Dim strSQL As String
Set db = CurrentDb()
Set rs = db.OpenRecordset("SELECT [staffid] From [Staff Table]WHERE [First]= '" & Text5.Value & "', [Last] = '" & Text7.Value & "'")
rs.MoveFirst
PermanentStaffID = db.Staff.Column(0)
If anyone can help me figure this out it would be great!
Thanks
-Sam
The first tab has a place where htey enter thier first name and last name into 2 text boxes and then saves it into a staff table. there are numbers assigned to each staff in that table which are called Staff ID.
The way this form is set up is that a new staff can enter in thier information without having to enter in thier first and last name for each page.
I think i need to assign a global variable, but i am not sure how.
Here is what i have on the general part of the vba code
Option Compare Database
Dim PermanentStaffID As Integer
Dim db As Database
Dim rs As Recordset
Dim strSQL As String
Set db = CurrentDb()
Set rs = db.OpenRecordset("SELECT [staffid] From [Staff Table]WHERE [First]= '" & Text5.Value & "', [Last] = '" & Text7.Value & "'")
rs.MoveFirst
PermanentStaffID = db.Staff.Column(0)
If anyone can help me figure this out it would be great!
Thanks
-Sam