Here is what I have....
I have a main from called Equipment it has 2 subforms one for the IP Data and
one for Budget Data.
When I click the command button it opens the sub form however it does not seem to copy the IDTag to the subfrom EuqipmentID area so that everything is linked together right.
My Tables are:
tblEquipment
IDTag - Txt & PK
EquipmentType
Location
LocationDesc
Mfg
Model
SerialNum
PONum
Contract
WarType
WarExpDate
Surplus
SurplusDate
InventoryDate
Notes
tblBudget
ID - Auto # & PK
EquipmentID - Txt
BdgYear
Expenditure
Purpose
tblIPData
ID -Auto # & PK
EquipmentID - txt
MAC
IP
SN
GW
PDNS
SDNS
Wireless
Relationships are:
tblEquipment to tblBudget on IDTag = EquipmentID One-To-Many all from tblEquipment and only those from tblBudget where fields are equal.
tblEquipment to tblIPData on IDTag = EquipmentID One-To-Many all from tblEquipment and only those from tblIPData where fields are equal.
Here is my code for the command buttons:
IPData
Private Sub IPData_Click()
On Error GoTo Err_IPData_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmIPData"
stLinkCriteria = "[EquipmentID]=""" & Me![IDTag] & """"
DoCmd.OpenForm stDocName, acFormDS, , stLinkCriteria
Forms!frmIPData!equipmentid.DefaultValue = Me.IDTag
DoCmd.MoveSize 3 * 1440, 2 * 1440, 9.5 * 1440, 5 * 1440
Exit_IPData_Click:
Exit Sub
Err_IPData_Click:
MsgBox Err.Description
Resume Exit_IPData_Click
End Sub
Budget
Private Sub Budget_Click()
On Error GoTo Err_Budget_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmBudget"
stLinkCriteria = "[EquipmentID]=" & Me![IDTag]
DoCmd.OpenForm stDocName, acFormDS, , stLinkCriteria
Forms!frmbudget!equipmentid.DefaultValue = Me.IDTag
DoCmd.MoveSize 3 * 1440, 2 * 1440, 5.4 * 1440, 7 * 1440
Exit_Budget_Click:
Exit Sub
Err_Budget_Click:
MsgBox Err.Description
Resume Exit_Budget_Click
End Sub
I have a main from called Equipment it has 2 subforms one for the IP Data and
one for Budget Data.
When I click the command button it opens the sub form however it does not seem to copy the IDTag to the subfrom EuqipmentID area so that everything is linked together right.
My Tables are:
tblEquipment
IDTag - Txt & PK
EquipmentType
Location
LocationDesc
Mfg
Model
SerialNum
PONum
Contract
WarType
WarExpDate
Surplus
SurplusDate
InventoryDate
Notes
tblBudget
ID - Auto # & PK
EquipmentID - Txt
BdgYear
Expenditure
Purpose
tblIPData
ID -Auto # & PK
EquipmentID - txt
MAC
IP
SN
GW
PDNS
SDNS
Wireless
Relationships are:
tblEquipment to tblBudget on IDTag = EquipmentID One-To-Many all from tblEquipment and only those from tblBudget where fields are equal.
tblEquipment to tblIPData on IDTag = EquipmentID One-To-Many all from tblEquipment and only those from tblIPData where fields are equal.
Here is my code for the command buttons:
IPData
Private Sub IPData_Click()
On Error GoTo Err_IPData_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmIPData"
stLinkCriteria = "[EquipmentID]=""" & Me![IDTag] & """"
DoCmd.OpenForm stDocName, acFormDS, , stLinkCriteria
Forms!frmIPData!equipmentid.DefaultValue = Me.IDTag
DoCmd.MoveSize 3 * 1440, 2 * 1440, 9.5 * 1440, 5 * 1440
Exit_IPData_Click:
Exit Sub
Err_IPData_Click:
MsgBox Err.Description
Resume Exit_IPData_Click
End Sub
Budget
Private Sub Budget_Click()
On Error GoTo Err_Budget_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmBudget"
stLinkCriteria = "[EquipmentID]=" & Me![IDTag]
DoCmd.OpenForm stDocName, acFormDS, , stLinkCriteria
Forms!frmbudget!equipmentid.DefaultValue = Me.IDTag
DoCmd.MoveSize 3 * 1440, 2 * 1440, 5.4 * 1440, 7 * 1440
Exit_Budget_Click:
Exit Sub
Err_Budget_Click:
MsgBox Err.Description
Resume Exit_Budget_Click
End Sub