Hey everyone, I have a little bit of a dilemna.
I have a form that I am using to enter/view specific file information. From a drop down menu the user can selection File_ID, and based on what the user selects I want to pull up the rest of the information in that table row where File_ID = the ID selected by the user. I am having a bit of trouble getting the form fields to populate with this information.
Here is what I have so far:
I keep getting an error saying that my datatype is wrong. Any suggestions on what I am doing wrong? Thanks in advance.
I have a form that I am using to enter/view specific file information. From a drop down menu the user can selection File_ID, and based on what the user selects I want to pull up the rest of the information in that table row where File_ID = the ID selected by the user. I am having a bit of trouble getting the form fields to populate with this information.
Here is what I have so far:
Code:
Dim fileID As Long
fileID = Me.File_ID
Dim db As Database
Dim rst As Recordset
Set db = CurrentDb()
Set rst = db.OpenRecordset("File Information")
Dim mySelect As String
Dim myFrom As String
Dim myWhere As String
Dim mySQL As String
mySelect = "SELECT * "
myFrom = "FROM [File Information] "
myWhere = "WHERE [File Information].File_ID = """ & fileID & """"
mySQL = mySelect & myFrom & myWhere & ";"
DoCmd.GoToRecord acDataForm, "File Information Form", acGoTo, mySQL
I keep getting an error saying that my datatype is wrong. Any suggestions on what I am doing wrong? Thanks in advance.