Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2009
    Posts
    3

    Unanswered: update many text fields based on a combo box if statment required??

    Hi,
    my name is andrew I am doing this as a favour to my boss, and have limited access exp, can some please help me!??
    I have a combo box (productname) the rowsource is based upon another combo box (categoryname), works no problem, with a query. 'after update' on the productname I have this

    Private Sub ProductName_AfterUpdate()
    Me.fooditem1 = Me![ProductName].Column(1)
    Me.calories1 = Me![ProductName].Column(2)
    End Sub

    this also works the 2nd combo box (productname) selection send the info to 2 fields on the form. want i need to do update many fields based on consecutive choice, to specify that :

    if the fooditem1 field and the calories1 already have a selection from the combo box (productname). then the next (productname combo box) choice will update the next two field on my form fooditem2 and calories2.
    i have 10 food fields and calorie fields in my form, and i dont want 2 combo boxes corresponding to each of the 10 fields, but want the combo box productname to cascade down and update all fields that are null

    any ideas!? i have a feeling an iif null then update next field type of statmenet but dont have much idea what im doing

    thankyou thankyou thankyou to anyone that replies

    andrew

  2. #2
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    i have 10 food fields and calorie fields in my form, and i dont want 2 combo boxes corresponding to each of the 10 fields, but want the combo box productname to cascade down and update all fields that are null
    It sounds to me like you actually need a subform and I suspect your table design may not be normalised.
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

Posting Permissions

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