Re: How do you display the values of a recordset in a message?
- From: Jack <Jack@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 15 Aug 2007 10:42:03 -0700
Thanks Alex for your help. I appreciate it. THe code change works fine when I
have one record out of sync. However, when more than one record is out of
sync, then only the first record is getting displayed in the message box. I
would like to display all the records in the messagebox. Is this possible by
change of code. Thanks again.
"Alex Dybenko" wrote:
Hi,.
try this:
Dim TBS_db As Database
Dim TBS_rs As Recordset
Dim str_SQL As String
Set TBS_db = CurrentDb
str_SQL = "SELECT qryDistinctTBSGroup.[TBS Grp] AS NotInMaster,
dbo_tblLineItems.LineItemID FROM
qryDistinctTBSGroup LEFT JOIN dbo_tblLineItems ON qryDistinctTBSGroup.[TBS
Grp] = dbo_tblLineItems.LineItemID ORDER BY qryDistinctTBSGroup.[TBS Grp]"
Set TBS_rs = TBS_db.OpenRecordset(str_SQL)
If Not TBS_rs.EOF Then
if isnull(TBS_rs!LineItemID) then
Forms!frmMainMenu!Command32.Visible = True
MsgBox ("You cannot run reports unless TBS Master table is in sync with
tblTBS TBSGroup, value: " & TBS_rs![TBS Grp] & ". Please check records to
add")
Exit Sub
Else
DoCmd.OpenForm "frmReportsMenu", acNormal, , , , acWindowNormal
End If
--
Best regards,
___________
Alex Dybenko (MVP)
http://alexdyb.blogspot.com
http://www.PointLtd.com
"Jack" <Jack@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:AEAD1B2F-ABD2-4A9A-8067-40556AC7C3B4@xxxxxxxxxxxxxxxx
Hi,
I have the following code that checks to see if the master table has
TBSGROUP as null value when compared to the TBSGROUP in the main table. If
there is null value in MASTER TABLE then I am trying not to allow the
report
menu to open up. At the same time I am displaying message to update the
master table that has null value. However, I would like to tell the user
in
the message box the value of the tbsgroup that need to be filled in the
master table. How does one display the value in the message box? Any help
is
appreciated. Thanks.
CODE:
Dim TBS_db As Database
Dim TBS_rs As Recordset
Dim str_SQL As String
Set TBS_db = CurrentDb
str_SQL = "SELECT qryDistinctTBSGroup.[TBS Grp] AS NotInMaster FROM
qryDistinctTBSGroup LEFT JOIN dbo_tblLineItems ON qryDistinctTBSGroup.[TBS
Grp] = dbo_tblLineItems.LineItemID WHERE (((dbo_tblLineItems.LineItemID)
Is
Null)) ORDER BY qryDistinctTBSGroup.[TBS Grp]"
Set TBS_rs = TBS_db.OpenRecordset(str_SQL)
If Not TBS_rs.EOF Then
Forms!frmMainMenu!Command32.Visible = True
MsgBox ("You cannot run reports unless TBS Master table is in sync with
tblTBS TBSGroup. Please check records to add")
Exit Sub
Else
DoCmd.OpenForm "frmReportsMenu", acNormal, , , , acWindowNormal
End If
- Follow-Ups:
- Re: How do you display the values of a recordset in a message?
- From: pietlinden@xxxxxxxxxxx
- Re: How do you display the values of a recordset in a message?
- References:
- Re: How do you display the values of a recordset in a message?
- From: Alex Dybenko
- Re: How do you display the values of a recordset in a message?
- Prev by Date: Delete query maximum values
- Next by Date: Re: Multiselect listbox as criteria
- Previous by thread: Re: How do you display the values of a recordset in a message?
- Next by thread: Re: How do you display the values of a recordset in a message?
- Index(es):
Relevant Pages
|
|