Results 1 to 8 of 8
  1. #1
    shabbaranks is offline Competent Performer
    Windows 7 32bit Access 2007
    Join Date
    Oct 2011
    Posts
    162

    Is it possible to convert a drop down number list to a negative?

    Hi all..



    I have a drop down list which contains numbers. On occasion I migght need to add a negative number to a subform from the drop down list. Is it possible to insert a tick box which can active as a trigger which turns the number in the list to a negative number?

    Thanks

  2. #2
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    no you can't turn the number into a neg, but what you can do is check the tick box for TRUE on the event that you're doing an activity on.

    if it's true change the numeric to a neg in the code that you're currently using.

  3. #3
    shabbaranks is offline Competent Performer
    Windows 7 32bit Access 2007
    Join Date
    Oct 2011
    Posts
    162
    The event that the activity is to be applied to is just a list from a table, so there's no code involved. Is this still possible?

    Thanks

  4. #4
    Toyman is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2011
    Posts
    233
    Quote Originally Posted by shabbaranks View Post
    The event that the activity is to be applied to is just a list from a table, so there's no code involved. Is this still possible?

    Thanks
    Give us an example of what you are trying to do. Once you select a value from the combo box, what happens

  5. #5
    shabbaranks is offline Competent Performer
    Windows 7 32bit Access 2007
    Join Date
    Oct 2011
    Posts
    162
    Ok so an example is hours are from 0.5, 1 up to 10. I have created a query based on the hours table which makes them all negative. What I am now trying to do is give the user an option to select positive or negative values from the 2 different tables within the combo box - have I explained myself right?

    Thanks

  6. #6
    Toyman is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2011
    Posts
    233
    Quote Originally Posted by shabbaranks View Post
    Ok so an example is hours are from 0.5, 1 up to 10. I have created a query based on the hours table which makes them all negative. What I am now trying to do is give the user an option to select positive or negative values from the 2 different tables within the combo box - have I explained myself right?

    Thanks
    So, what you are trying to do is to be able to enter -2 hour, etc into the field? If this is so, then create the option box for negative. In the after update event for the picklist, put the following.

    Select Case Me.YourOptionBoxName
    Case True 'is negative
    Me.YourHourEntryFieldName = Me.YourHourEntryFieldName * -1
    Case False 'is Positive
    Me.YourHourEntryFieldName
    End Select

  7. #7
    shabbaranks is offline Competent Performer
    Windows 7 32bit Access 2007
    Join Date
    Oct 2011
    Posts
    162
    Im either mi-understaing you or your mis-understanding me. Im not entering from a field, its from a drop down list as per here

    http://imgur.com/aVLJx

    I have 2 tables one with positive lists like the one above and one with negative lists as per here:

    http://imgur.com/wiDqX

    Is there a way via a check box or something where I can switch the combo box between the two?

    Thanks

  8. #8
    Toyman is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2011
    Posts
    233
    Quote Originally Posted by shabbaranks View Post
    Im either mi-understaing you or your mis-understanding me. Im not entering from a field, its from a drop down list as per here

    http://imgur.com/aVLJx

    I have 2 tables one with positive lists like the one above and one with negative lists as per here:

    http://imgur.com/wiDqX

    Is there a way via a check box or something where I can switch the combo box between the two?

    Thanks
    Ok, you could do this in the after update event of the option check box.

    Dim Mysql as string

    Select Case Me.YourOptionBoxName
    Case True 'positive value
    Mysql ="Select YourValueFieldName From YourPositiveTable"
    Case False 'Negative Value
    Mysql ="Select YourValueFieldName From YourNegativeTable"
    End Select

    Me.YourComboBoxName.RowSource=Mysql
    Me.YourComboBoxName.Requery

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 4
    Last Post: 06-16-2011, 09:30 PM
  2. Convert auto number
    By JonB1 in forum Access
    Replies: 2
    Last Post: 02-20-2011, 10:26 PM
  3. Convert Negative Values to Positive
    By creativefusion in forum Queries
    Replies: 1
    Last Post: 10-21-2009, 02:47 AM
  4. Number convert to date
    By Argus in forum Programming
    Replies: 1
    Last Post: 08-05-2009, 02:21 PM
  5. Sum Of Positive Number and Negative Number
    By maysamab in forum Reports
    Replies: 1
    Last Post: 10-20-2008, 04:06 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums