Results 1 to 6 of 6
  1. #1
    Join Date
    Feb 2004
    Location
    UK
    Posts
    246

    Unanswered: Code not working

    Hi,
    Can anyone tell me why the following bit of code doesn't work


    If IsNull(Me.Parameter_form.Value) Then
    Me.Parameter_based.Value = "No"
    ElseIf Me.Parameter_form.Value <> Null Then
    Me.Parameter_based = "Yes"
    End If


    "Parameter_form" is a combo box and "Parameter_based" is text box

    This bit of code is attached to the form close button, but it never updates the text box. Is this because the if statement is looking at a combo box and you have to treat them differently and if so how do I evaluate the value?

    The form is continuous

    Regards
    John

  2. #2
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    ElseIf Not IsNull(Me.Parameter_form) Then


    Nothing can ever really = or <> null, as null is an unknown.
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

  3. #3
    Join Date
    Feb 2004
    Location
    UK
    Posts
    246
    Hi Teddy
    Thanks very much for that it seems to work now but with one problem..........................it only updates the last entry that has been entered or amended. All the other records on the form are unchanged. As this is a continuous form the records will be entered more than one at a time.

    Do you know a way around this?

    Regards
    John

  4. #4
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    Calls to an object on a continious form will only affect the object for the currently selected record. If you wish to alter the ENTIRE recordset, you would be better advised to run an UPDATE statement and requery the form.
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

  5. #5
    Join Date
    Feb 2004
    Location
    UK
    Posts
    246
    Thanks for that Teddy, I'll be slack as I don't know the UPDATE method so I'll use 2 update queries

    Regards
    John

  6. #6
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    Yeah, that's what I meant. Update statement is the same as an update query.
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

Posting Permissions

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