Allow user to create msgbox

S

Sammie

Is it possible to enable a user to create a msgbox? I would like the user to
create a message for a customer when the customer places a new order.

I have tblCustomers and tblOrders. The user would go to the customer record
and enter the reminder message. On the orders form, after the user selects
the customer from the list, their message would pop up. When the reminder
message is no longer need, the user could turn it off back on the customer
record.

I create these types of msgboxes all the time, but I am the only one who can
remove them when they are no longer needed, becuase my users don't use visual
basic. I would like the user to be able to do this.
 
D

Damon Heron

Not a msgbox, but a popup form. first you will have to add two fields, one
for the msg, and one yes/no field, to your customer or order table - or
create a related msg table, and when the customer is selected, the form will
open - provided the checkbox you have on the form is false.
You've seen these in various software "Do not show this screen again" etc.
as a checkbox.
On the Customer form,
If Not (DLookup("DiscontinueMsg", "tblCustomer", "CustomerID= " & CustID))
Then
DoCmd.openform "frmMsg", , , , , , [CustID]
End If
'discontinue Msg is a field in tblCustomer that is either true or false.

Then on the msg form,

Private Sub Form_Load()
Me.txtID = Me.OpenArgs 'this loads the customerID from the custfrm into a
(hidden)textbox 'on the msg from -txtID
End Sub

Private Sub CmdClose_Click()
On Error GoTo Err_CmdClose_Click
Dim strsql As String
If IsNull(Me.Check1) Then Me.Check1 = 0
strsql = "Update tblCustomer set tblCustomer.DiscontinueMsg= " & [Check1] &
" where tblCustomer.CustomerID = " & [txtID] & ""
DoCmd.RunSQL strsql 'here we update the discontinue msg field in tblCustomer
DoCmd.Close acForm, "frmMsg"

Exit_CmdClose_Click:
Exit Sub

Err_CmdClose_Click:
MsgBox Err.Description
Resume Exit_CmdClose_Click

End Sub

Damon
 

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