I'm sure this a simple fix, but I am brand new to VBA coding.
I am trying to build a MS Access database with a simple purpose. My goal is to have the user click the "Query _______" button, (where the blank part is either part number or stock number) then have them input their information in the boxes and select the aircraft platform. I have that part figured out, but I am having trouble code the actual query.
I have two tables named "MV-22" and "CH-53E". I have a main form where the user select the query they want, either by part number or stock number. Once they select one, it opens another form for either part number or stock number respectively. They then type the information they want to query and select the table (aircraft platform) from a drop down menu. From there, I'm trying to get that to cross to whatever table they selected, and pull the user input.
Hopefully that makes sense.. Here is the code I have to run the query. It has been saying "Compile error: Expected: List separator or )." Like i said im sure its a simple fix, I'm just new to all of this.. Thank you for all of the help!
Private Sub btnView_Click()
Dim PN As String
Dim TMS As String
PN = [frmSheetsPN]![txtbxPN]![Text]
TMS = [frmSheetsPN]![dropTMS]![Text]
DoCmd.RunSQL ("SELECT * FROM" '&TMS&' "WHERE PartNo LIKE" '&PN&')
End Sub