J
Jack
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
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