concatenate child records

G

Guest

Yes - thanks, Duane!

I'm embarrassed that I missed that!

In my struggles I found another error. The concatenation query was joined to
tblProfiles when it needed to be joined to tblFGProcessing.

Thanks a million for all of your time and effort!

--
www.Marzetti.com


Duane Hookom said:
One issue I found was a text box bound to an expression containing
[tblProfiles.txtProfileID]. When I changed this to [txtProfileID] the error
message went away.

--
Duane Hookom
MS Access MVP

JohnLute said:
Sorting and grouping is empty. You've got mail!

--
www.Marzetti.com


Duane Hookom said:
Check your sorting and grouping dialog.

If you can't find this, you may want to send me copy of your mdb. My
email
will filter out any emails with large attachments so you would need to
contact me outside of the newsgroup prior to attempting to send me a
file.
--
Duane Hookom
MS Access MVP

Thanks for all your help, Duane! This works and I removed the filter
property
value but the dreaded error continues!

"The specified field '[tblProfiles.txtProfileID]' could refer to more
than
one table listed in the FROM clause of your SQL statement."

This is driving me nuts! Also, this is keeping me from publishing a
revised
database that needs to go into systems today!

ARRRRRRRRRRRRRGGGGGGGGGGGGGHHHHHHHHHHHHHH!!!

--
www.Marzetti.com


:

I would change the code to the following which assumes txtProfileID is
text:

Private Sub Preview_Click()
On Error GoTo Err_Preview_Click

Dim stDocName As String
Dim strWhere as String
strWhere = "[txtProfileID] = """ & _
Forms![frmFinishedGoods].form![txtProfileID] & """"
DoCmd.OpenReport Me!cbSelectReport, acPreview _
, , strWhere

Exit_Preview_Click:
Exit Sub

Err_Preview_Click:
MsgBox Err.Description
Resume Exit_Preview_Click

End Sub

This is the Preview event of my current button. I developed this a
couple
years ago with the help of another MVP:

Private Sub Preview_Click()
On Error GoTo Err_Preview_Click

Dim stDocName As String

DoCmd.OpenReport Me!cbSelectReport, acPreview, ,
"[tblProfiles.txtProfileID] =
Forms![frmFinishedGoods].form![txtProfileID]"

Exit_Preview_Click:
Exit Sub

Err_Preview_Click:
MsgBox Err.Description
Resume Exit_Preview_Click

End Sub

How should this be modified? I'm really getting lost here.

--
www.Marzetti.com


:

I can't understand how removing a filter property value would cause
a
report
to not open.

Here is a post regarding the Where clause that I posted in another
forum:
Create a form with two text boxes
Text box 1
Name: txtStartDate
Format: Short Date
Text box 2
Name: txtEndDate
Format: Short Date
Default Value: Date()

Use the Command Button wizard in the Tool Box to create a button
that
opens
your report. After the wizard finishes, right-click the button and
choose
Build Event. Your code might look like the following. I have added
some
lines as noted to use the text boxes:

Private Sub cmdPreviewReport_Click()
On Error GoTo Err_cmdPreviewReport_Click

Dim stDocName As String
'ADDED NEXT 2 LINES
Dim strWhere as String
strWhere = "1=1 "

stDocName = "Catalog"
'ADDED NEXT 8 LINES
If Not IsNull(Me.txtStartDate) Then
strWhere = strWhere & " And [DateField]>=#" & _
Me.txtStartDate & "# "
End If
If Not IsNull(Me.txtEndDate) Then
strWhere = strWhere & " And [DateField]<=#" & _
Me.txtEndDate & "# "
End If
'ADDED 2 commas and strWhere
DoCmd.OpenReport stDocName, acPreview, , strWhere

Exit_cmdPreviewReport_Click:
Exit Sub

Err_cmdPreviewReport_Click:
MsgBox Err.Description
Resume Exit_cmdPreviewReport_Click

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