Vis Basic Question

T

Tom B

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
 
G

Guest

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
 
T

Tom B

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
 
D

david epsom dot com dot au

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top