subforms Access 2000

G

Gale Coleman

Hello all,

I am using Access 2000 on a Windows 2000 machine.

I have a subform in a report (RLetPBIreviewPB) that seems to pull the text
from a record (LPBILreviewPB) in the FormsL table. I cannot seem to copy
that same report and have it pull from a different record in that same
FormsL table. It doesn't seem like it should be that hard, but it sure has
me stumped.

The coding on the back end of the report states this:

Option Compare Database
Option Explicit
Dim Lcrit As String
Dim sVar As String
Dim x As Double
Dim xs As String
Private Sub Report_Open(Cancel As Integer)
On Error GoTo ERR405598
xs = PLetterH
If isLoaded("inpTickleLet") Then
Reports("RLetPBIreviewPB").RecordSource = "qLTRC"
Else
Reports("RLetPBIreviewPB").RecordSource = "qLTR"
End If
If isLoaded("inpClientsForms") Then
If IsBlank(Forms![inpClientsForms]![Combo29]) Then
xs = PLetterH
Else
xs = Forms![inpClientsForms]![Combo29]
End If
Me![LetterH].ControlSource = "= """ & xs & """"
Lcrit = Forms![inpClientsForms]![Field462]
sVar = Forms![inpClientsForms]![MoreText]
x = Forms![inpClientsForms]![Frame20]
If Len(sVar) > 0 Then
If x = 1 Then
Me![TextMore].ControlSource = "= """ & sVar & """"
ElseIf x = 2 Then
Me![TextMore2].ControlSource = "= """ & sVar & """"
End If
End If
Me![Text36].Caption = Lcrit
DoCmd.Close acForm, "inpClientsForms"
ElseIf isLoaded("qbfClientC") Then
If IsBlank(Forms![qbfClientC]![Combo29]) Then
xs = PLetterH
Else
xs = Forms![qbfClientC]![Combo29]
End If
Me![LetterH].ControlSource = "= """ & xs & """"
Lcrit = Forms![qbfClientC]![FormPick]
Me![Text36].Caption = Lcrit
ElseIf isLoaded("inpClients") Then
Lcrit = pubString
Me![Text36].Caption = Lcrit
Me![LetterH].ControlSource = "= """ & xs & """"
ElseIf isLoaded("inpFullIntake") Then
Lcrit = pubString
Me![Text36].Caption = Lcrit
Me![LetterH].ControlSource = "= """ & xs & """"
ElseIf isLoaded("inpTickleLet") Then
If IsBlank(Forms![inpTickleLet]![Combo29]) Then
xs = PLetterH
Else
xs = Forms![inpTickleLet]![Combo29]
End If
Lcrit = Forms![inpTickleLet]![Field462]
sVar = Forms![inpTickleLet]![MoreText]
If Len(sVar) > 0 Then
Me![TextMore].ControlSource = "= """ & sVar & """"
End If
Me![Text36].Caption = Lcrit
Me![LetterH].ControlSource = "= """ & xs & """"
DoCmd.Close acForm, "inpTickleLet"
End If
Exit Sub
ERR405598:
RootErr
Resume Next
End Sub


I just can't figure out how it knows what form to pull out of the FormsL
table? Any ideas? There is no coding on the back of the subform, although
it has this coding in the record source of the subform:

SELECT DISTINCTROW [FORMSL].[FormsText] FROM FORMSL WHERE
((([FORMSL].[FormsName])=[Reports]![RLetPBIreviewPB]![Text36].Caption));

It looks like [Text36].Caption should equal the form name I am pushing in
the print list, but it is not working, I am forgetting something someone.

Any suggestions?
 
L

lexi

why do i have this in my folder
Gale Coleman said:
Hello all,

I am using Access 2000 on a Windows 2000 machine.

I have a subform in a report (RLetPBIreviewPB) that seems to pull the text
from a record (LPBILreviewPB) in the FormsL table. I cannot seem to copy
that same report and have it pull from a different record in that same
FormsL table. It doesn't seem like it should be that hard, but it sure has
me stumped.

The coding on the back end of the report states this:

Option Compare Database
Option Explicit
Dim Lcrit As String
Dim sVar As String
Dim x As Double
Dim xs As String
Private Sub Report_Open(Cancel As Integer)
On Error GoTo ERR405598
xs = PLetterH
If isLoaded("inpTickleLet") Then
Reports("RLetPBIreviewPB").RecordSource = "qLTRC"
Else
Reports("RLetPBIreviewPB").RecordSource = "qLTR"
End If
If isLoaded("inpClientsForms") Then
If IsBlank(Forms![inpClientsForms]![Combo29]) Then
xs = PLetterH
Else
xs = Forms![inpClientsForms]![Combo29]
End If
Me![LetterH].ControlSource = "= """ & xs & """"
Lcrit = Forms![inpClientsForms]![Field462]
sVar = Forms![inpClientsForms]![MoreText]
x = Forms![inpClientsForms]![Frame20]
If Len(sVar) > 0 Then
If x = 1 Then
Me![TextMore].ControlSource = "= """ & sVar & """"
ElseIf x = 2 Then
Me![TextMore2].ControlSource = "= """ & sVar & """"
End If
End If
Me![Text36].Caption = Lcrit
DoCmd.Close acForm, "inpClientsForms"
ElseIf isLoaded("qbfClientC") Then
If IsBlank(Forms![qbfClientC]![Combo29]) Then
xs = PLetterH
Else
xs = Forms![qbfClientC]![Combo29]
End If
Me![LetterH].ControlSource = "= """ & xs & """"
Lcrit = Forms![qbfClientC]![FormPick]
Me![Text36].Caption = Lcrit
ElseIf isLoaded("inpClients") Then
Lcrit = pubString
Me![Text36].Caption = Lcrit
Me![LetterH].ControlSource = "= """ & xs & """"
ElseIf isLoaded("inpFullIntake") Then
Lcrit = pubString
Me![Text36].Caption = Lcrit
Me![LetterH].ControlSource = "= """ & xs & """"
ElseIf isLoaded("inpTickleLet") Then
If IsBlank(Forms![inpTickleLet]![Combo29]) Then
xs = PLetterH
Else
xs = Forms![inpTickleLet]![Combo29]
End If
Lcrit = Forms![inpTickleLet]![Field462]
sVar = Forms![inpTickleLet]![MoreText]
If Len(sVar) > 0 Then
Me![TextMore].ControlSource = "= """ & sVar & """"
End If
Me![Text36].Caption = Lcrit
Me![LetterH].ControlSource = "= """ & xs & """"
DoCmd.Close acForm, "inpTickleLet"
End If
Exit Sub
ERR405598:
RootErr
Resume Next
End Sub


I just can't figure out how it knows what form to pull out of the FormsL
table? Any ideas? There is no coding on the back of the subform, although
it has this coding in the record source of the subform:

SELECT DISTINCTROW [FORMSL].[FormsText] FROM FORMSL WHERE
((([FORMSL].[FormsName])=[Reports]![RLetPBIreviewPB]![Text36].Caption));

It looks like [Text36].Caption should equal the form name I am pushing in
the print list, but it is not working, I am forgetting something someone.

Any suggestions?
 

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