B
Bob M
I am using Microsoft Access 2002 SP3. I have one main table named Issues
and several supporting tables all related on the ID field. The Issues table
ID field has an Autonumber to populate the field when a new record is
created. What I would like to accomplish is to have the supporting table’s
auto fill the ID field using the last ID created in the Issues table.
On my Issues form I have a combo box that depending on the selection
will open the corresponding form to the particular table. When the form
opens I want the Issues form to close and the ID field to auto fill with the
last record ID in the Issues table. After I placed a request in this forum
I now have the ability to open a new record that will autofill the ID field.
My goal is to have the ability to create one or more records in the secondary
tables created with the same linking ID.
Any and all assistance is greatly appreciated,
Bob
Below is what I currently have:
Private Sub Combo32_Change()
DoCmd.RunCommand acCmdSaveRecord
Dim strPushID As Integer
strPushID = Me.[ID]
If (Forms!FrmIssues!Combo32 = "Ordering") Then
DoCmd.OpenForm "FrmOrder", acNormal, "", "", , acNormal
Forms!frmOrder![ID] = strPushID
ElseIf (Forms!FrmIssues!Combo32 = "Service Call") Then
DoCmd.OpenForm "FrmServiceCall", acNormal, "", "", , acNormal
Forms!frmServiceCall![ID] = strPushID
ElseIf (Forms!FrmIssues!Combo32 = "Consumables") Then
DoCmd.OpenForm "FrmConsumables", acNormal, "", "", , acNormal
Forms!frmConsumables![ID] = strPushID
End If
End Sub
and several supporting tables all related on the ID field. The Issues table
ID field has an Autonumber to populate the field when a new record is
created. What I would like to accomplish is to have the supporting table’s
auto fill the ID field using the last ID created in the Issues table.
On my Issues form I have a combo box that depending on the selection
will open the corresponding form to the particular table. When the form
opens I want the Issues form to close and the ID field to auto fill with the
last record ID in the Issues table. After I placed a request in this forum
I now have the ability to open a new record that will autofill the ID field.
My goal is to have the ability to create one or more records in the secondary
tables created with the same linking ID.
Any and all assistance is greatly appreciated,
Bob
Below is what I currently have:
Private Sub Combo32_Change()
DoCmd.RunCommand acCmdSaveRecord
Dim strPushID As Integer
strPushID = Me.[ID]
If (Forms!FrmIssues!Combo32 = "Ordering") Then
DoCmd.OpenForm "FrmOrder", acNormal, "", "", , acNormal
Forms!frmOrder![ID] = strPushID
ElseIf (Forms!FrmIssues!Combo32 = "Service Call") Then
DoCmd.OpenForm "FrmServiceCall", acNormal, "", "", , acNormal
Forms!frmServiceCall![ID] = strPushID
ElseIf (Forms!FrmIssues!Combo32 = "Consumables") Then
DoCmd.OpenForm "FrmConsumables", acNormal, "", "", , acNormal
Forms!frmConsumables![ID] = strPushID
End If
End Sub