+ Reply to Thread
Results 1 to 2 of 2

check box ifs/then

  1. #1
    Registered User
    Join Date
    06-04-2008
    MS-Off Ver
    2007
    Posts
    37

    check box ifs/then

    the post originally started in the excel forum...here:

    http://www.excelforum.com/excel-prog...ml#post2240662

    however, now the question is about access...

    Hi, here is the situation:

    ive been trying to get this to work but no luck...

    Text Box: Email

    Check Box 1: newsletter
    Check Box 2: promotions
    Check Box 3: HolidayCard

    Check Box 4: BadEmail

    Heres what i need:

    if any of the checkboxes (1, 2 or 3) is checked, and there is no text in the text box, then checkbox 4 will get checked...

    however, i would still like a manual option with checkbox 4

    thanks in advance for all your help...

    shy
    Leith Ross answered:

    Hello shy,

    Here is the code for the UserForm. The Sub "CheckStatus" needs to be placed in the General Declarations section (Very Top) of the UserForm. Each check box except the last calls this code. This allows you to manually change Checkbox4.
    Code:

    Sub CheckStatus()
    If (CheckBox1 Or CheckBox2 Or CheckBox3) And TextBox1 = "" Then
    CheckBox4.Value = True
    End If
    End Sub


    Private Sub CheckBox1_Click()
    CheckStatus
    End Sub

    Private Sub CheckBox2_Click()
    CheckStatus
    End Sub

    Private Sub CheckBox3_Click()
    CheckStatus
    End Sub
    ok, that worked fine in excel (thanx), but we decided to switch to access, and now im totally lost. how can i implement this into an access for...where do i put the macro??

    thanks alot


    ps: i guess this should be moved to access programming

  2. #2
    Registered User
    Join Date
    11-09-2008
    Location
    germany
    Posts
    74

    Re: check box ifs/then

    Have you tried it in Access?

    Have you put the same checkboxes with the same names on an Access form?

    If not try it. Then cut and copy your code to the VB editor of Access for the form.

    Then debug.

    A couple of hints which people use for Access

    Instead of "CheckBox1" you might need "Me.CheckBox1"

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1