Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Making checkboxes and mail merge work in a form.

Status
Not open for further replies.

soorags

MIS
Mar 19, 2007
44
GB
On a form called frmNz I have added 2 checkboxes, Website? and Email? (i.e. is there a website
and/or email?) I would like it so that if these are selected with ticks then website and email addresses
can be entered into the below textboxes, otherwise the website and email address textboxes
go grey (i.e they cannot be used if they are not ticked) How can I make this possible?

Also I would like a function where I can select companies from the "search results"
subform table and then mail merge letters to them. How is this possible?

Can I add an attachment at all?

Gurdip.
 
You could set the 'Enabled' property of the text box to 'No' and then use the 'After Update' event of the check boxes to enable the corresponding text boxes when the check box is ticked. Something like...

Code:
Private Sub chkWebsite_AfterUpdate()
    If Me.chkWebsite = True Then
       Me.txtWebsite.Enabled = True
    Else:
       Me.txtWebsite.Enabled = False
       Me.txtWebsite.Value = Null
    End If
End Sub

You might need to do something similar with the 'On Current' event of the form to handle the properties of the text box as the current record changes too.

Any good?
 
I get a message whilst trying to disable the control saying:

"You can't disable a control while it has the focus."

Gurdip.
 
Trying to disable a control that has focus, is not possible. So make sure you are not on the field...

Pampers [afro]
Keeping it simple can be complicated
 
It works now. How can I get this to work?
Selecting some companies from the subform and then clicking on a "Mail Merge" command button on the form to perform the Microsoft Word mail merge application with these companies.

Gurdip.
 
Hi soorags,
So everyone can participate, please post a new thread for the new problem

Pampers [afro]
Keeping it simple can be complicated
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top