R
Ray Todd Jr
I have requested help previously and Jeanette has kindly and diligently tried
to help me, however, I'm not sure that I am providing all of the needed
information to identify where my coding error is causing the problem.
I have a subform (subDEFENDANTS) that list the individual defendants. There
is a text box that indicates if a particular defendant has been served. By
clicking on this text box, the user can either view the existing data about
the service -or- add a record about the service. Here is the code I am using:
Dim stdoc As String
Dim stdoc1 As String
stdoc = "frmPROCESSSERVICE-status"
stdoc1 = "frmPROCESSSERVICE-statusadd"
If DCount("DefendantID", "taPROCESSSERVICE",
"DefendantID=forms!frmMAIN!subDEFENDANTS!DefendantID") > 0 Then
DoCmd.OpenForm stdoc, , , "DefendantID =" &
Forms!frmMAIN!subDEFENDANTS!DefendantID
Else
DoCmd.OpenForm stdoc1, , , , acFormAdd, acDialog, "DefendantID=" &
Forms!frmMAIN!subDEFENDANTS!DefendantID
End If
The record source for each of form frmPROCESSSERVICE-status is:
ProcessServiceID Autonumber taProcessService
DefendantID Number (Long) taProcessService
SummonsIssueDate Date (Short) taProcessService
(other fields not mentioned)
The problem that I am having:
If I add a new record, the DefendantID is never filled in with the correct
DefendantID (always remains blank) even after I enter data in the other
fields.
The properties for:
frmPROCESSSERVICE-status (to view existing data)
Properties
AllowAdditions: True AllowDatasheetView: True
AllowDeletions: True AllowEditing: True
AllowEdits: True AllowFilters: True
AllowFormView: True AllowPivotChartView: True
AllowPivotTableView: True AllowUpdating: No
AutoCenter: False AutoResize: True
BorderStyle: Sizable CloseButton: True
ControlBox: True DataEntry: False
DefaultEditing: 2 DefaultView: Single Form
frmPROCESSSERVICE-statusadd (to add a record)
AllowAdditions: True AllowDatasheetView: True
AllowDeletions: True AllowEditing: True
AllowEdits: True AllowFilters: True
AllowFormView: True AllowPivotChartView: True
AllowPivotTableView: True AllowUpdating: No
AutoCenter: False AutoResize: True
BorderStyle: Sizable CloseButton: True
ControlBox: True DataEntry: True
This is obviously an error that I am making but cannot identify where I am
making such mistake.
Any help or suggestions is much appreciated....
Thanks,
Ray.
to help me, however, I'm not sure that I am providing all of the needed
information to identify where my coding error is causing the problem.
I have a subform (subDEFENDANTS) that list the individual defendants. There
is a text box that indicates if a particular defendant has been served. By
clicking on this text box, the user can either view the existing data about
the service -or- add a record about the service. Here is the code I am using:
Dim stdoc As String
Dim stdoc1 As String
stdoc = "frmPROCESSSERVICE-status"
stdoc1 = "frmPROCESSSERVICE-statusadd"
If DCount("DefendantID", "taPROCESSSERVICE",
"DefendantID=forms!frmMAIN!subDEFENDANTS!DefendantID") > 0 Then
DoCmd.OpenForm stdoc, , , "DefendantID =" &
Forms!frmMAIN!subDEFENDANTS!DefendantID
Else
DoCmd.OpenForm stdoc1, , , , acFormAdd, acDialog, "DefendantID=" &
Forms!frmMAIN!subDEFENDANTS!DefendantID
End If
The record source for each of form frmPROCESSSERVICE-status is:
ProcessServiceID Autonumber taProcessService
DefendantID Number (Long) taProcessService
SummonsIssueDate Date (Short) taProcessService
(other fields not mentioned)
The problem that I am having:
If I add a new record, the DefendantID is never filled in with the correct
DefendantID (always remains blank) even after I enter data in the other
fields.
The properties for:
frmPROCESSSERVICE-status (to view existing data)
Properties
AllowAdditions: True AllowDatasheetView: True
AllowDeletions: True AllowEditing: True
AllowEdits: True AllowFilters: True
AllowFormView: True AllowPivotChartView: True
AllowPivotTableView: True AllowUpdating: No
AutoCenter: False AutoResize: True
BorderStyle: Sizable CloseButton: True
ControlBox: True DataEntry: False
DefaultEditing: 2 DefaultView: Single Form
frmPROCESSSERVICE-statusadd (to add a record)
AllowAdditions: True AllowDatasheetView: True
AllowDeletions: True AllowEditing: True
AllowEdits: True AllowFilters: True
AllowFormView: True AllowPivotChartView: True
AllowPivotTableView: True AllowUpdating: No
AutoCenter: False AutoResize: True
BorderStyle: Sizable CloseButton: True
ControlBox: True DataEntry: True
This is obviously an error that I am making but cannot identify where I am
making such mistake.
Any help or suggestions is much appreciated....
Thanks,
Ray.