Results 1 to 7 of 7
  1. #1
    kbahr99
    Guest

    Drop Down field treated as containing a value

    I am using Access 2000. I have a drop down field that is populated by a query on a look up table.

    I am using If-Then statement to set up conditions to open a form and filter the records to only display the ones that meet the criteria. I realize I am probably going about this the hard way and the reason I am doing it this way is that I trying not to redesign it too much (the project comes from forms and code written by someone else in Access 2.0).
    The problem I am having is that when I run the If-then statements, Access seems to think that the field has a value.

    Here is a copy of one that is not acting as I would think it would:

    If Me.ASSIGNEDTO = "" And Me.MODULE <> "" And Me.ERRPRI.Value = False And Me.Code.Value = False Then
    DoCmd.OpenForm "TRForm", acNormal, "ModuleOnly"
    End If

    In this case, it seems to think that Me.Module is not empty and is executing the command after the then.

    I am really confused. Is there some undocumented characteristic about Access I am not aware of?

    Thanks.

  2. #2
    2 Star Lounger
    Join Date
    Dec 2000
    Posts
    120
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Drop Down field treated as containing a value

    Try:

    isnull(Me.MODULE) = false

  3. #3
    kbahr99
    Guest

    Re: Drop Down field treated as containing a value

    It still thinks that the field contains something, though it looks blank. I tried recreating the field and it still reacts the same. The other field, me.assignedto seems to work correctly, which confuses me even more.

    My next idea is to totaly redo the form from scratch.

    Thanks Cpod for the input.

  4. #4
    kbahr99
    Guest

    Re: Drop Down field treated as containing a value

    I am really confused. I just created the form from scratch and copied the pasted the code from the old form into Word, then into Access to keep out any hidden stuff that may have been hanging around.

    When I tried to run it, I kept getting errors that Access didn't recognize the variables (it seemed to be thinking that I was using User defined data types or something) when all I was doing was using control names that I had used before.

    It still thinks that the me.module is = the name of the form. The me.assignedto control seems to be OK still. The only think I can think to do now is to totally start the whole project from scratch.

    Luckily I am going to stop working on it for the day, so I won't be wasting effort if someone can come up with a good idea.

    Thanks.

  5. #5
    2 Star Lounger
    Join Date
    Dec 2000
    Posts
    120
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Drop Down field treated as containing a value

    Module is a reserved word. Try changing the field name.

  6. #6
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Drop Down field treated as containing a value

    Furthermore, the Module object is a property of the form, and that's exactly the syntax you're using in your code.
    Charlotte

  7. #7
    kbahr99
    Guest

    Re: Drop Down field treated as containing a value

    Thank you for the input. It is giving starting to give me more logical results. I'm still missing something somewhere but it is related to something else. At least now I have something to work with.
    Thanks again!!!

Posting Permissions

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