D
doodle
Excel coder needs help with access:
Windows xp
Access 97
2 Forms from different tables - Teardown and Quality
1 standard link criteria between records - machine serial number
Teardown form has a command button that opens quality form using
standard link criteria.
What it does:
1. If there is a quality record with the same serial #, it opens the
form filtered to that record.
2. If there is no quality record with the same serial #, it asks the
user if they would like to copy over the machine data. If they answer
yes, it populates a few common fields that are sometimes the same data
and sometimes not.
all is good. until i found out that there will be more than one quality
report created per serial number and they want the ability to
automatically populate the fields for 2nd and 3rd, etc, etc, reports as
well.
What I need it to do:
1. If there is a quality record with the same serial #, prompt the user
with a message like this:
"There are x# of quality reports for this serial #. Would you like to
create a new report?
if vbYes - create new record in form, copying fields from Teardown
form.
if vbNo - filter to record(s) with serial #
****************************************************************************************
Here is my current code -////////////////////////////////////////////
-doodle
****************************************************************************************
Private Sub cmdViewQualityReport_Click()
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmEnterQualityDataFromTeardown"
stLinkCriteria = "[G_Machine_SN]=" & "'" & Me![Machine_SN] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria
DoCmd.OpenForm stDocName
End Sub
****************************************************************************************
Public Sub Form_Load()
Dim Answ1 As String
Dim txtFail As String
Dim stDocName As String
Dim stDocName_1 As String
'On Error Resume Next
stDocName = "frmEnterQualityDataFromTeardown"
stDocName_1 = "frmEnterTeardownData"
If IsNull([G_Machine_SN].Value) Then
Answ1 = MsgBox("Would you like to use the same failure
description in the quality report that you entered into the teardown
report?", _
vbYesNo, "Message From Adria...")
Select Case Answ1
Case vbYes
Me!DE_Failure_Descrip =
Forms!frmEnterTeardownData!FS_FailureDescrip
Me!G_MachineType =
Forms!frmEnterTeardownData!Machine_Type
Me!G_Machine_SN =
Forms!frmEnterTeardownData!Machine_SN
Me!G_Tech =
Forms!frmEnterTeardownData!Repair_Tech_Num
Me!DE_Tech =
Forms!frmEnterTeardownData!Repair_Tech_Num
Me!ID_Tech1 =
Forms!frmEnterTeardownData!Repair_Tech_Num
Me!ID_Tech2 =
Forms!frmEnterTeardownData!Repair_Tech_Num
Me!ID_Tech3 =
Forms!frmEnterTeardownData!Repair_Tech_Num
Me!ID_Tech4 =
Forms!frmEnterTeardownData!Repair_Tech_Num
Me!ID_Tech5 =
Forms!frmEnterTeardownData!Repair_Tech_Num
Me!ID_Tech6 =
Forms!frmEnterTeardownData!Repair_Tech_Num
Me!Cast_Num =
Forms!frmEnterTeardownData!Spindle_SN
Me!G_Unit_PN =
Forms!frmEnterTeardownData!Part_Number
Me!G_Max_RPM =
Forms!frmEnterTeardownData!Max_RPM
Case vbNo
Exit Sub
Case Else
Exit Sub
End Select
Else: Exit Sub
End If
End Sub
****************************************************************************************
Windows xp
Access 97
2 Forms from different tables - Teardown and Quality
1 standard link criteria between records - machine serial number
Teardown form has a command button that opens quality form using
standard link criteria.
What it does:
1. If there is a quality record with the same serial #, it opens the
form filtered to that record.
2. If there is no quality record with the same serial #, it asks the
user if they would like to copy over the machine data. If they answer
yes, it populates a few common fields that are sometimes the same data
and sometimes not.
all is good. until i found out that there will be more than one quality
report created per serial number and they want the ability to
automatically populate the fields for 2nd and 3rd, etc, etc, reports as
well.
What I need it to do:
1. If there is a quality record with the same serial #, prompt the user
with a message like this:
"There are x# of quality reports for this serial #. Would you like to
create a new report?
if vbYes - create new record in form, copying fields from Teardown
form.
if vbNo - filter to record(s) with serial #
****************************************************************************************
Here is my current code -////////////////////////////////////////////
-doodle
****************************************************************************************
Private Sub cmdViewQualityReport_Click()
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmEnterQualityDataFromTeardown"
stLinkCriteria = "[G_Machine_SN]=" & "'" & Me![Machine_SN] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria
DoCmd.OpenForm stDocName
End Sub
****************************************************************************************
Public Sub Form_Load()
Dim Answ1 As String
Dim txtFail As String
Dim stDocName As String
Dim stDocName_1 As String
'On Error Resume Next
stDocName = "frmEnterQualityDataFromTeardown"
stDocName_1 = "frmEnterTeardownData"
If IsNull([G_Machine_SN].Value) Then
Answ1 = MsgBox("Would you like to use the same failure
description in the quality report that you entered into the teardown
report?", _
vbYesNo, "Message From Adria...")
Select Case Answ1
Case vbYes
Me!DE_Failure_Descrip =
Forms!frmEnterTeardownData!FS_FailureDescrip
Me!G_MachineType =
Forms!frmEnterTeardownData!Machine_Type
Me!G_Machine_SN =
Forms!frmEnterTeardownData!Machine_SN
Me!G_Tech =
Forms!frmEnterTeardownData!Repair_Tech_Num
Me!DE_Tech =
Forms!frmEnterTeardownData!Repair_Tech_Num
Me!ID_Tech1 =
Forms!frmEnterTeardownData!Repair_Tech_Num
Me!ID_Tech2 =
Forms!frmEnterTeardownData!Repair_Tech_Num
Me!ID_Tech3 =
Forms!frmEnterTeardownData!Repair_Tech_Num
Me!ID_Tech4 =
Forms!frmEnterTeardownData!Repair_Tech_Num
Me!ID_Tech5 =
Forms!frmEnterTeardownData!Repair_Tech_Num
Me!ID_Tech6 =
Forms!frmEnterTeardownData!Repair_Tech_Num
Me!Cast_Num =
Forms!frmEnterTeardownData!Spindle_SN
Me!G_Unit_PN =
Forms!frmEnterTeardownData!Part_Number
Me!G_Max_RPM =
Forms!frmEnterTeardownData!Max_RPM
Case vbNo
Exit Sub
Case Else
Exit Sub
End Select
Else: Exit Sub
End If
End Sub
****************************************************************************************