G
Guest
Hello,
I know that I should know this but....
1. When I open a bound form, the form opens to the first record.
2. I use an InputBox to prompt the user for a value used to query the DB.
3. I perform a DCount to veryify what I want is in the database.
4. Assuming the record exists, I want to display the record that I'm after.
How do I make the form display the record that I want using the key value
entered by the user?
Here is my brief piece of code:
Dim strS3ID As String
strS3ID = UCase(InputBox("Please enter the S3ID of the employee whose
role you wish to change."))
If DCount("S3ID", "tbl_Empl_Master", "S3ID = '" & strS3ID & "'") <> 1 Then
MsgBox ("The S3ID number you entered was not found in the database.")
Else
'make the record display on the form. strS3ID is the PK.
End If
End Sub
I know that I should know this but....
1. When I open a bound form, the form opens to the first record.
2. I use an InputBox to prompt the user for a value used to query the DB.
3. I perform a DCount to veryify what I want is in the database.
4. Assuming the record exists, I want to display the record that I'm after.
How do I make the form display the record that I want using the key value
entered by the user?
Here is my brief piece of code:
Dim strS3ID As String
strS3ID = UCase(InputBox("Please enter the S3ID of the employee whose
role you wish to change."))
If DCount("S3ID", "tbl_Empl_Master", "S3ID = '" & strS3ID & "'") <> 1 Then
MsgBox ("The S3ID number you entered was not found in the database.")
Else
'make the record display on the form. strS3ID is the PK.
End If
End Sub