Vis Basic Question

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have the following code in an Event Procedure in a "on Current" part of the
form.
I have two datasheets, one a subform of another where I select an item on
the first datasheet and information is shown on that item in the second
datasheet.

I want to add a third datasheet and also changes when I select an item in
the first datasheet.

I don't know how to write this code but need to add that third datasheet
(called RFI Subform) into this code.

Can someone help me out with this?

Thanks, code is shown below



Sub Form_Current()

Dim ParentDocName As String

On Error Resume Next
ParentDocName = Me.Parent.Name

If Err <> 0 Then
GoTo Form_Current_Exit
Else
On Error GoTo Form_Current_Err
Me.Parent![Submittal Subform].Requery
End If

Form_Current_Exit:
Exit Sub

Form_Current_Err:
MsgBox Error$
Resume Form_Current_Exit

End Sub
 
This just refreshes the datasheet.

The only line which does anything in this event is:
Me.Parent![Submittal Subform].Requery

You can add another line in the same place like this

me.parent![RFI Subform].requery

(david)


Tom B said:
I have the following code in an Event Procedure in a "on Current" part of the
form.
I have two datasheets, one a subform of another where I select an item on
the first datasheet and information is shown on that item in the second
datasheet.

I want to add a third datasheet and also changes when I select an item in
the first datasheet.

I don't know how to write this code but need to add that third datasheet
(called RFI Subform) into this code.

Can someone help me out with this?

Thanks, code is shown below



Sub Form_Current()

Dim ParentDocName As String

On Error Resume Next
ParentDocName = Me.Parent.Name

If Err <> 0 Then
GoTo Form_Current_Exit
Else
On Error GoTo Form_Current_Err
Me.Parent![Submittal Subform].Requery
End If

Form_Current_Exit:
Exit Sub

Form_Current_Err:
MsgBox Error$
Resume Form_Current_Exit

End Sub
 
I'm looking for both forms to refresh, how can I incorporate both lines in
that code?

david@epsomdotcomdotau said:
This just refreshes the datasheet.

The only line which does anything in this event is:
Me.Parent![Submittal Subform].Requery

You can add another line in the same place like this

me.parent![RFI Subform].requery

(david)


Tom B said:
I have the following code in an Event Procedure in a "on Current" part of the
form.
I have two datasheets, one a subform of another where I select an item on
the first datasheet and information is shown on that item in the second
datasheet.

I want to add a third datasheet and also changes when I select an item in
the first datasheet.

I don't know how to write this code but need to add that third datasheet
(called RFI Subform) into this code.

Can someone help me out with this?

Thanks, code is shown below



Sub Form_Current()

Dim ParentDocName As String

On Error Resume Next
ParentDocName = Me.Parent.Name

If Err <> 0 Then
GoTo Form_Current_Exit
Else
On Error GoTo Form_Current_Err
Me.Parent![Submittal Subform].Requery
End If

Form_Current_Exit:
Exit Sub

Form_Current_Err:
MsgBox Error$
Resume Form_Current_Exit

End Sub
 
I'm looking for both forms to refresh, how can I incorporate both lines

You can add the other line in the same place.

(david)


Tom B said:
I'm looking for both forms to refresh, how can I incorporate both lines in
that code?

david@epsomdotcomdotau said:
This just refreshes the datasheet.

The only line which does anything in this event is:
Me.Parent![Submittal Subform].Requery

You can add another line in the same place like this

me.parent![RFI Subform].requery

(david)


Tom B said:
I have the following code in an Event Procedure in a "on Current" part
of the
form.
I have two datasheets, one a subform of another where I select an item
on
the first datasheet and information is shown on that item in the second
datasheet.

I want to add a third datasheet and also changes when I select an item
in
the first datasheet.

I don't know how to write this code but need to add that third
datasheet
(called RFI Subform) into this code.

Can someone help me out with this?

Thanks, code is shown below



Sub Form_Current()

Dim ParentDocName As String

On Error Resume Next
ParentDocName = Me.Parent.Name

If Err <> 0 Then
GoTo Form_Current_Exit
Else
On Error GoTo Form_Current_Err
Me.Parent![Submittal Subform].Requery
End If

Form_Current_Exit:
Exit Sub

Form_Current_Err:
MsgBox Error$
Resume Form_Current_Exit

End Sub
 
Back
Top