Results 1 to 3 of 3
  1. #1
    jgelpi16 is offline Expert
    Windows XP Access 2007
    Join Date
    Mar 2010
    Location
    Charlotte, NC
    Posts
    544

    Question Re-curring FRUSTRATING issue

    I have a subform that populates a text box on my main form. However, that subform could have no value (when you open the form it is completely blank, don't really know how to explain it). I thought I had the code to solve the problem, but I have just encountered the issue again. Any help will be GREATLY appreciated.

    Code:
        If Len(Form_SfrmARsAge.txtAgePercent.Value & vbNullString) = 0 Then
            varAging = 0
        Else
            varAging = Form_SfrmARsAge.txtAgePercent.Value
        End If
    I keep getting the error message "You entered an expression that has no value.".

  2. #2
    Rawb is offline Expert
    Windows XP Access 2000
    Join Date
    Dec 2009
    Location
    Somewhere
    Posts
    875
    Try using the IsNumeric() Function instead. If it returns False, then set varAging to 0, otherwise set it to the value of Form_SfrmARsAge.txtAgePercent like so.

    Code:
        If IsNumeric(Form_SfrmARsAge.txtAgePercent.Value) = False Then
            varAging = 0
        Else
            varAging = Form_SfrmARsAge.txtAgePercent.Value
        End If
    I ran into a similar problem before and, after posting here, found out that the IsNumeric() Function will quietly "fail" to False if a (numeric) Field doesn't exist. If you use some of the other Functions, they can sometimes throw unexpected errors.

  3. #3
    Join Date
    Jun 2010
    Location
    Belgium
    Posts
    1,043
    Hi,

    how about using the good old Nz function?

    varAging = Nz(Forms("Form_SfrmArsAge").txtAgepercent,0)

    grNG

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

Similar Threads

  1. Referencing Issue
    By rosh41 in forum Forms
    Replies: 1
    Last Post: 07-15-2010, 04:09 AM
  2. Simple issue?
    By Patience in forum Access
    Replies: 8
    Last Post: 05-29-2010, 07:02 AM
  3. adp accessing issue
    By fillerup in forum Security
    Replies: 3
    Last Post: 03-10-2010, 09:59 AM
  4. Keep together issue (Access 12)
    By alpha in forum Reports
    Replies: 2
    Last Post: 06-02-2009, 08:21 AM
  5. new issue about autoincreasednum
    By tinytree in forum Queries
    Replies: 0
    Last Post: 05-06-2009, 09:28 PM

Tags for this Thread

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