You entered an expression that has no value.

Posted on 2006-04-25
Last Modified: 2007-12-19
With CurrentDb.OpenRecordset("ContractDatabase", dbOpenDynaset)
      .FindFirst "ContractNo= '" & Me.Text67 & "'  And Clientname = '" & Me.Text69 & "'  "
If Not .NoMatch Then
     If MsgBox("The Contract already exists, please click on update button to make changes.", vbOKCancel) = vbCancel Then Exit Sub
End If
     !ContractNo = Me.Text67
     !ClientName = Me.Text69
     !ActiveInactive = IIf(Me.Active.Value = True, "yes", "no") <---- I get the error here
     !TotalContractValue = Me.Text75
     !TaskNo = Me.Text77
     !StartYear = Me.Text81
     !EndYear = Me.Text83
     !Name = Me.Text85
     !FinalValue = Me.Text87
     !Description = Me.Text89
     !Location = Me.Combo93
     !Partners = Me.Combo116
     !RCM = IIf(Me.Check102 = True, "yes", "no")
     !RTS = IIf(Me.Check104 = True, "yes", "no")
     !RGS = IIf(Me.Check106 = True, "yes", "no")
     !RGSt = IIf(Me.Check108 = True, "yes", "no") '
     !RCE = IIf(Me.Check110 = True, "yes", "no")
     !RCS= IIf(Me.Check112 = True, "yes", "no")
     !RBM = IIf(Me.Check114 = True, "yes", "no")
End With

Please help.
Question by:Aiysha
    LVL 65

    Accepted Solution

        !ActiveInactive = IIf(Nz(Me.Active, "Wahoooo") = True, "yes", "no") <---- Give this a whirl.  
    LVL 65

    Expert Comment

    by:Jim Horn
    btw you should really rename your controls to something that has meaning of what the control represents, such as txtContractNumber, chkRCM, and txtStartYear, instead of Check102, Text75, and Combo34384532.  This will create less confusion as you code.

    This style will differ by developer, of course, but the most commonly used for Access is Leszynski/Reddick

    Hope this helps.
    LVL 44

    Assisted Solution

    What you wrote will only work if all the controls your a providing values to in the form of 'Yes' and 'No' are in fact textboxes.  If they are Option Buttons or Check Boxes then replace:

    !ActiveInactive = IIf(Me.Active.Value = True, "yes", "no")


     !ActiveInactive = IIf(Me.Active.Value = True, -1, 0)

    Likewise for the rest of the Boolean replacements in your code.

    LVL 16

    Assisted Solution

    The first thing to check it the data type of .Active to insure it isn't something like a Text field.  As long as it is a numberic field you should be OK but it is best not to check for true (which is actually an alias for -1) since anything not 0 (ie 1, 2, 3, etc) is technically true.  All you really need is to use the IIF statment to evaluate the value, if it's Non-0 it will return true and respond accordinly.  

    Just in case it is a Null I've thrown in the Nz() function to make it false it that event.  

    If all this fails I'd check the recordset to see if it has a field named "Active".  The absence of such a field would again explain what is happening.

    !ActiveInactive = IIf(Nz(Me.Active.Value,0), "yes", "no")

    Featured Post

    Gigs: Get Your Project Delivered by an Expert

    Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

    Join & Write a Comment

    In the article entitled Working with Objects – Part 1 (, you learned the basics of working with objects, properties, methods, and events. In Work…
    QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
    Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
    In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…

    754 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now