M
Michelle
I have a main from called Equipment it has 2 subforms one for the IP Data and
one for Budget Data.
When I cleck the command button it opens the sub form however it does not
seem to copy the IDTag to the subfrom IDTag 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
tblBudgeting
ID - Auto # & PK
IDTag
BdgYear
Expenditure
Purpose
tblIPData
ID -Auto # & PK
EIDTag
MAC
IP
SN
GW
PDNS
SDNS
Wireless
Relationships are:
tblEquipment to tblBudgeting on IDTag = IDTag One-To-Many all from
tblEquipment and only those from tblBudgeting where fields are equal.
tblEquipment to tblIPData on IDTag = EIDTag 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 = "[EIDTag]=""" & Me![IDTag] & """"
DoCmd.OpenForm stDocName, acFormDS, , stLinkCriteria
Forms!frmIPData!EIDTag.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 = "[IDTag]=" & Me![ID]
DoCmd.OpenForm stDocName, acFormDS, , stLinkCriteria
Forms!frmbudget!IDTag.DefaultValue = Me.ID
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
one for Budget Data.
When I cleck the command button it opens the sub form however it does not
seem to copy the IDTag to the subfrom IDTag 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
tblBudgeting
ID - Auto # & PK
IDTag
BdgYear
Expenditure
Purpose
tblIPData
ID -Auto # & PK
EIDTag
MAC
IP
SN
GW
PDNS
SDNS
Wireless
Relationships are:
tblEquipment to tblBudgeting on IDTag = IDTag One-To-Many all from
tblEquipment and only those from tblBudgeting where fields are equal.
tblEquipment to tblIPData on IDTag = EIDTag 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 = "[EIDTag]=""" & Me![IDTag] & """"
DoCmd.OpenForm stDocName, acFormDS, , stLinkCriteria
Forms!frmIPData!EIDTag.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 = "[IDTag]=" & Me![ID]
DoCmd.OpenForm stDocName, acFormDS, , stLinkCriteria
Forms!frmbudget!IDTag.DefaultValue = Me.ID
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