B
Ben
brief synopsis
Database designed to track export animal consignments. Thus we have
export animals grouped by consignment ID - referential integrity to a
Consignment table (2 columns - date and ID(primary key)
Now here lies the problem I have a button on my consignment form with
the following code
Private Sub Open_animal_details_Click()
On Error GoTo Err_Open_animal_details_Click
Dim stDocName As String
Dim stLinkCriteria As String
Dim animalctl As String
Dim ConID As Integer
ConID = Forms!Consignment![Consignment ID]
stDocName = "Animal Details"
animalctl = "Consignment ID"
stLinkCriteria = "[Consignment ID]=" & Me![Consignment ID]
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, ,
acMenuVer70
DoCmd.OpenForm stDocName, , , stLinkCriteria
DoCmd.GoToControl animalctl
Forms![Animal Details]![Consignment ID] = ConID
DoCmd.GoToControl "Animal Name"
Forms![Animal Details]![Consignment ID].Enabled = False
DoCmd.Close acForm, "Consignment", acSaveYes
Exit_Open_animal_details_Click:
Exit Sub
Err_Open_animal_details_Click:
MsgBox Err.Description
Resume Exit_Open_animal_details_Click
End Sub
That works fine opens the details form and sets the Consignment id
correctly and all
the problem is when I return to the Consignment form using the
following code
Private Sub closebacktoconsignment_Click()
On Error GoTo Err_closebacktoconsignment_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Consignment"
DoCmd.OpenForm stDocName, , , stLinkCriteria
DoCmd.Close acForm, "Animal Details", acSaveYes
Exit_closebacktoconsignment_Click:
Exit Sub
Err_closebacktoconsignment_Click:
MsgBox Err.Description
Resume Exit_closebacktoconsignment_Click
End Sub
It nicely goes back...but when I try to generate a report with my next
click based on the consignment ID - it doesnt seem to have saved the
data...even refreshing doesn't seem to help.
Anyideas what I might be doing wrong
Cheers guys
Ben
Ps just so we are clear - first shot at a database and I possibly may
be in over my head
Database designed to track export animal consignments. Thus we have
export animals grouped by consignment ID - referential integrity to a
Consignment table (2 columns - date and ID(primary key)
Now here lies the problem I have a button on my consignment form with
the following code
Private Sub Open_animal_details_Click()
On Error GoTo Err_Open_animal_details_Click
Dim stDocName As String
Dim stLinkCriteria As String
Dim animalctl As String
Dim ConID As Integer
ConID = Forms!Consignment![Consignment ID]
stDocName = "Animal Details"
animalctl = "Consignment ID"
stLinkCriteria = "[Consignment ID]=" & Me![Consignment ID]
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, ,
acMenuVer70
DoCmd.OpenForm stDocName, , , stLinkCriteria
DoCmd.GoToControl animalctl
Forms![Animal Details]![Consignment ID] = ConID
DoCmd.GoToControl "Animal Name"
Forms![Animal Details]![Consignment ID].Enabled = False
DoCmd.Close acForm, "Consignment", acSaveYes
Exit_Open_animal_details_Click:
Exit Sub
Err_Open_animal_details_Click:
MsgBox Err.Description
Resume Exit_Open_animal_details_Click
End Sub
That works fine opens the details form and sets the Consignment id
correctly and all
the problem is when I return to the Consignment form using the
following code
Private Sub closebacktoconsignment_Click()
On Error GoTo Err_closebacktoconsignment_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Consignment"
DoCmd.OpenForm stDocName, , , stLinkCriteria
DoCmd.Close acForm, "Animal Details", acSaveYes
Exit_closebacktoconsignment_Click:
Exit Sub
Err_closebacktoconsignment_Click:
MsgBox Err.Description
Resume Exit_closebacktoconsignment_Click
End Sub
It nicely goes back...but when I try to generate a report with my next
click based on the consignment ID - it doesnt seem to have saved the
data...even refreshing doesn't seem to help.
Anyideas what I might be doing wrong
Cheers guys
Ben
Ps just so we are clear - first shot at a database and I possibly may
be in over my head