Hello all. Here is my scenario:
I have a database where we track information for our fleet of trucks. So far everything is working perfectly! What I am looking to do is to create some type of “Service Work” report where I and the other mechanics can record the work that we do on the vehicles; almost like a “Vehicle History Record”.
The problem is that I am not sure what the best way to do this is. Here is what I have done thus far:
- I created a table titled “WORK”
- In that table I have the following columns:
- ID (Autonumber)
- tb_CUA (the Vehicle Number)
- Date (the date of the work being done)
- Tech (Lookup of the Tech doing the work)
- Service Type (Lookup from another table, “SrvcType” which lists the types of service that can be done)
- Notes (Memo field)
- I also created a form titled “WORK”
- It is a continuous form that lists all of the fields from the table “WORK”
- I also placed a button on the main form that opens the “WORK” form and associates it to the tb_CUA (Vehicle Number) from the main form. Here is the code for that button:
Code:
Private Sub Command883_Click()
'Open Form (Notice the frm prefix to let the coder know that its a form)
'Notice that form is opened in ADD mode, and with a filter applied.
DoCmd.OpenForm "WORK", acNormal, , "[CUA#]=" & Me.tb_CUA, acFormAdd
'Manipulate the form
Dim f As Form
Set f = Forms("WORK")
'Set defaultvalue so that all records automatically get assigned the new id
f.tb_CUA.DefaultValue = Me.tb_CUA
'Set the form to be modal. This will prevent the user from clicking outside the form, until the form is closed again.
f.Modal = True
End Sub
So far everything is working fine. Then I noticed my issue… the problem that I am having is that there may be several entries into the “Service Type” and “Memo” fields for the same Vehicle Number, date & Tech. Therefore, the Tech should not have to enter that information again each time, unless of course it is a new record altogether.
Can anyone suggest a way of doing this in a way that a beginner might be able to understand???
Thanks in advance for your help with this issue!
dgaletar