Tech Support Guy banner
Status
Not open for further replies.
1 - 13 of 13 Posts

·
Registered
Joined
·
23 Posts
Discussion Starter · #1 ·
I have a form with several tabbed subforms. Several of the subforms are for gathering peoples names and information (lastname, firstname etc.) the forms are named for the persons role (reporting party, complainant, victim, etc.)

How can I post information entered into one subform if a check box is selected? (reporting party = complainant)

I am trying to eliminate repetitive entries but have to duplicate information across tables.


XP / Access 2003
 

·
Registered
Joined
·
19,896 Posts
You should not be duplicating data across tables or forms, so you are doing the right thing.
But why have more than one subform, why not just have one subform with a Combo Box to select their Role?
 

·
Registered
Joined
·
23 Posts
Discussion Starter · #3 ·
That is the way I have been instructed to do it by the Boss.

He wants to be able to click on a tab and see each persons info.

Each person could have multiple roles in the incident.
 

·
Registered
Joined
·
19,896 Posts
Bosses :rolleyes:
You could set it up so that any record entered in to a particular Tab would have the "Role" field set to the role designated by the Tab Name.
 

·
Registered
Joined
·
23 Posts
Discussion Starter · #5 ·
Boss said table is NOT an option. :rolleyes:

I know this can be done but I cannot get the code right.

This is the code I have currently:

Private Sub ISCOMPLAINANT_DblClick(Cancel As Integer)
On Error GoTo Err_ISCOMPLAINANT_DblClick


Me.Parent.Complainant.Form.Race = Me.Race
Me.Parent.Complainant.Form.POB = Me.POB
Me.Parent.Complainant.Form.Occupation = Me.Occupation


Exit_ISCOMPLAINANT_DblClick:
Exit Sub
Err_ISCOMPLAINANT_DblClick:
MsgBox Err.Description
Resume Exit_ISCOMPLAINANT_DblClick

End Sub

Returns the following error:

Object doesn't support this property or method

Button is located on the Reporting Party subform and trying to post to the
Complainant subform. :confused:
 

·
Registered
Joined
·
23 Posts
Discussion Starter · #7 ·
It is not highlighting any of the code.

Error box pops up and when you closed it returns to the form.



He can be a little frustrating at times ;) but he just explained his reason. (juvenile law):rolleyes:
 

·
Registered
Joined
·
19,896 Posts
Try remming out the last 2 lines of code and then try removing the Form from
Me.Parent.Complainant.Form.Race = Me.Race
to
Me.Parent.Complainant.Race = Me.Race

Also check that the name of the subform is correct by trying some VBA in the Mainform that refers to it.
 

·
Registered
Joined
·
19,896 Posts
RANCHLAW, I have re-read your thread from the beginning and I am quite willing to look at your database. But before I do I need to confirm how you think it should operate, rather than trying to get what you have to work.
Are you entering a Person's data in one subform and then trying to put the same data in to another subform (which groups them by Role?

If so then the operating method is wrong, if you enter the initial data in say Tab 1 then you should save the data and then ReQuery the other tabbed Subforms to update them with the data.
 

·
Registered
Joined
·
23 Posts
Discussion Starter · #12 ·
Thanks for all your help.
Created a button instead of a check box.
Here is the code that works.

Private Sub ISCOMPLAINANT_Click()
On Error GoTo Err_ISCOMPLAINANT_Click


If MsgBox("Are you sure you wish to copy this Reporting Party" & vbCrLf & _
"to the Complainant tab?", vbCritical + vbYesNo) = vbYes Then

Me.Parent.subComplainant.Form.Last_Name = Me.Last_Name
Me.Parent.subComplainant.Form.First_Name = Me.First_Name
Me.Parent.subComplainant.Form.Middle_Name = Me.Middle_Name
Me.Parent.subComplainant.Form.Photo = Me.Photo

End If
Exit_ISCOMPLAINANT_Click:
Exit Sub

Err_ISCOMPLAINANT_Click:
MsgBox Err.Description
Resume Exit_ISCOMPLAINANT_Click

End Sub
 
1 - 13 of 13 Posts
Status
Not open for further replies.
Top