Results 1 to 5 of 5
  1. #1
    Join Date
    Apr 2008

    Unanswered: Trouble with coding..

    Hi all, I visited the site afew weeks back and got great feedback.

    Im back with another problem hoping that someone might be able to help me,

    I have a form on my database called "Stock Maintenance". The form has been designed so users select from two combo boxes one named "Part No" the other named "Descripton", once they have made there selection, there information appears in boxes ready for the user to edit.

    The fields i have for editing are "Description, Components, Min QTY and QTY".

    I have attached code to Min QTY and QTY, so when Min QTY is below 10, the box changed to Red and a message box appears asking if the user wants to send an email notifying the adminstrator that Stock QTY is low and more needs to be ordered.

    Unfortaunelty, this code applies for all Part No's and Descriptions in the combo box.

    What i'm after is a way that i can set each part no and description seperately:

    example: Battery - (below <5) Front Panel - (below <15)

    I've tried to express what im trying to do as much as possible;

    any help on this matter would be greatly appricated.

  2. #2
    Join Date
    Nov 2007
    Adelaide, South Australia
    I don't think I understand the problem.

    Is it just me?
    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

  3. #3
    Join Date
    Apr 2004
    Kingsland, Georgia
    could you possibly post a screenshot of the form? Though a valiant effort, it really isn't clear enough (for me, at least) to determine exactly what you're asking for. The part where thing get muddy is:
    each part no and description seperately:

    example: Battery - (below <5) Front Panel - (below <15)

  4. #4
    Join Date
    Feb 2004
    Chicago, IL
    I think what you are looking for is Conditional Formatting. If the the value in QTY is less than the value in MIN QTY then make them red, correct? Are the editable fields in a subform/datasheet? Or a Combo Box?

    In a subform/datasheet it is possible to use Conditional Formatting, but in a Combo Box with multiple columns I don't believe it is possible.

  5. #5
    Join Date
    Sep 2007
    Global Village
    You should use "Select Case" statement which gives you to decide in each case what to do
    Select Case me.components
    case "Battery"
    if me.qty<5 then
    <do this>
    case "Front Panel"
    if me.qty<15 then
    <do that>
    case else
    end select

    The only problem with this solution is it is not automated and you should add each brand to your code; however you can write code to automate it also

Posting Permissions

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