I have an access program tha I have been using for years. I love it, have slowly been searching and making updates here and there. Anywho, I have a main form that has the customers information and then I have a window on a lower part of the main for that is a subform. So I have Customer ID, and Problem ID. Those are the two IDs for the data. I also have a report that this all prints too called "Work Order Preview Report"
when I click on the buttom it asks me for the customer id and then the problem ID like before. I have to manually put them in. I would love it to be automatic. I have the following code in another database that I use. It's a single form, but works great.
Private Sub Command313_Click()
Dim strWhere As String
If Me.Dirty Then 'Save any edits.
Me.Dirty = False
End If
If Me.NewRecord Then 'Check there is a record to print
MsgBox "Select a record to print"
Else
strWhere = "[Customer ID] = " & Me.[Problem ID]
DoCmd.OpenReport "Work Order Preview Report", acViewPreview, , strWhere
End If
End Sub
I have just copy and pasted things from here to there. I understand a little of the programing language but not much. Any help would be great.
Thanks.
Chad