N
nbohana
My application has many forms. The main form (sales) updates three other
forms (Checker, Buildings and Estimator), 'Buildings' is a subform of sales.
The updates are ok, but saving and closing does not work, espically
'Buildings'. Closing 'Checker and Estimator does not work. What am I doing
wrong?? The code follows:
Private Sub Save_Click()
On Error GoTo Err_Save_Click
Dim stDocName As String
Dim stLinkCriteria As String
Dim bnum As Integer
Dim bsux As String
bnum = Me![bidnumber]
bsux = Me![bidsuffix]
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
stDocName = "Buildings"
stLinkCriteria = "[bid-number]=" & bnum
DoCmd.OpenForm stDocName, , , stLinkCriteria
Forms!buildings.[bid-number] = bnum
Forms!buildings.[buildings] = Forms!buildings.[buildings] + 1
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
stDocName = "Checker"
stLinkCriteria = "[bid-number]=" & bnum
DoCmd.OpenForm stDocName, , , stLinkCriteria
DoCmd.GoToRecord , , acNewRec
Forms!checker.[bid-number] = bnum
Forms!checker.[bid-suffix] = bsux
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
Rem DoCmd.Close
stDocName = "Estimating"
stLinkCriteria = "[bid-number]=" & bnum
DoCmd.OpenForm stDocName, , , stLinkCriteria
DoCmd.GoToRecord , , acNewRec
Forms!Estimating.[bidnumber] = bnum
Forms!Estimating.[bidsuffix] = bsux
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
Rem DoCmd.Close
forms (Checker, Buildings and Estimator), 'Buildings' is a subform of sales.
The updates are ok, but saving and closing does not work, espically
'Buildings'. Closing 'Checker and Estimator does not work. What am I doing
wrong?? The code follows:
Private Sub Save_Click()
On Error GoTo Err_Save_Click
Dim stDocName As String
Dim stLinkCriteria As String
Dim bnum As Integer
Dim bsux As String
bnum = Me![bidnumber]
bsux = Me![bidsuffix]
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
stDocName = "Buildings"
stLinkCriteria = "[bid-number]=" & bnum
DoCmd.OpenForm stDocName, , , stLinkCriteria
Forms!buildings.[bid-number] = bnum
Forms!buildings.[buildings] = Forms!buildings.[buildings] + 1
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
stDocName = "Checker"
stLinkCriteria = "[bid-number]=" & bnum
DoCmd.OpenForm stDocName, , , stLinkCriteria
DoCmd.GoToRecord , , acNewRec
Forms!checker.[bid-number] = bnum
Forms!checker.[bid-suffix] = bsux
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
Rem DoCmd.Close
stDocName = "Estimating"
stLinkCriteria = "[bid-number]=" & bnum
DoCmd.OpenForm stDocName, , , stLinkCriteria
DoCmd.GoToRecord , , acNewRec
Forms!Estimating.[bidnumber] = bnum
Forms!Estimating.[bidsuffix] = bsux
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
Rem DoCmd.Close