Results 1 to 7 of 7
  1. #1
    Summit_IT is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Jan 2019
    Location
    Virginia
    Posts
    47

    Changing format of a textbox filled with combobox column value


    I have a form with three textboxes that are based on one combobox. Two of the three are Yes/No and the last one is Currency. The Yes/No shows as "0" or "1". I want "Yes" or "No". The last one shows a General number. I need it to show it as Currency.

    "=[cboMPL_ID].[Column](5)"

  2. #2
    Micron is online now Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,801
    You should be able to format the text boxes on the property sheet. Check 'format' line on format tab of the sheet - Yes/No is an option that should be there for at least the first two you mention. However, I'm thinking there may be something going on behind the scenes (like in the table fields) because the norm for true/false (or yes/no) is that number values are -1 and 0 respectively. You say you're getting 1, not -1.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  3. #3
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,525
    set the txtbox value yes/no:

    vRet = cboMPL_ID.Column(5)
    Text1 = Switch(vRet = 1, "Yes", vRet = 0, "No")


    format property of the 3rd text box as currency

  4. #4
    Summit_IT is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Jan 2019
    Location
    Virginia
    Posts
    47
    Quote Originally Posted by ranman256 View Post
    set the txtbox value yes/no:

    vRet = cboMPL_ID.Column(5)
    Text1 = Switch(vRet = 1, "Yes", vRet = 0, "No")
    This worked!
    Thanks!
    format property of the 3rd text box as currency
    I had set the format to currency. What about this?

  5. #5
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,430
    data in a combo or listbox is all 'typed' as text.

    try
    =cCurr([cboMPL_ID].[Column](5))

  6. #6
    Summit_IT is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Jan 2019
    Location
    Virginia
    Posts
    47
    Used something like this "ListPrice: Format([MasterListPrice],'$#,###.##')" in combobox query and this fixed it.

    Thanks to all!

  7. #7
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,430
    the format function generates a text value, which is OK providing you don't want to use it in a calculation

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

Similar Threads

  1. Replies: 5
    Last Post: 03-21-2018, 06:53 PM
  2. Replies: 8
    Last Post: 02-08-2018, 09:58 AM
  3. Replies: 3
    Last Post: 02-01-2018, 03:10 AM
  4. Replies: 2
    Last Post: 08-09-2016, 11:06 AM
  5. Replies: 2
    Last Post: 10-29-2013, 04:38 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