Results 1 to 3 of 3
  1. #1
    erich_18 is offline Novice
    Windows 10 Access 2016
    Join Date
    Sep 2018
    Posts
    11

    Texbox #Error

    I have a Clear button on my form, this button clears the data from the comboboxes and refreshes the form so the textboxes show 0. here's the code in the button:



    Me.cboOrigin = ""
    Me.cboPOL = ""
    Me.cboTS1 = ""
    Me.cboTS2 = ""
    Me.cboTS3 = ""
    Me.cboPOD = ""
    Me.cboDest = ""
    Me.cboPOLMT = ""
    Me.cboTSMT = ""
    Me.cboPODMT = ""
    Refresh

    the button worked fine when my tables where in an access back-end, but after migrating my access tables to sql server (express 2017) after clicking the Clear button the textboxes show #Error. but when selecting data in the comboboxes the textboxes will show the correct values, its only after hitting the Clear button.

    dont understandr why. any ideas?

    expession in the textboxes:
    =Nz(DLookUp("Column","Query"),0)

    tks

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Maybe set them to Null instead of empty string.

    Are these controls UNBOUND?

    The DLookup is incomplete since there is no WHERE criteria. Instead of DLookup better to include fields in combobox RowSource then reference combobox Column index, index begins with 0 so if data is in column 2 the index is 1: =[cboSomething].Column(1).
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    erich_18 is offline Novice
    Windows 10 Access 2016
    Join Date
    Sep 2018
    Posts
    11
    Thanks June7. I went with your suggestion and included the fields in coombobox rowsource..etc and now it works fine.

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

Similar Threads

  1. Linking a hyperlink (texbox) to a Photo
    By johnnyBQue in forum Access
    Replies: 5
    Last Post: 12-02-2014, 07:58 AM
  2. Mulity Texbox Filtering not working
    By inthu in forum Access
    Replies: 5
    Last Post: 01-30-2014, 11:20 PM
  3. Formating a texbox
    By alextol in forum Forms
    Replies: 23
    Last Post: 10-01-2013, 11:50 AM
  4. Combobox with texbox as criteria
    By putte11 in forum Forms
    Replies: 5
    Last Post: 12-10-2012, 05:32 PM
  5. click label -> append text to texbox
    By cnstarz in forum Access
    Replies: 5
    Last Post: 06-15-2011, 06:09 AM

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