Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!
  1.   Become a Supporter    ::   Make a Contribution   
    Target (Recurring Monthly): $200 :: Achieved: $98

Error: You entered an expression that has an invalid...

Discussion in 'Information Technology' started by Simon Harris, Jul 28, 2006.

  1. Simon Harris

    Simon Harris
    Expand Collapse
    Guest

    Hi All,

    My code is causing an error on my clients machine, the same code works fine
    for me. The error is as follows:

    Run-time error '2455':
    You entered an expression that has an invalid reference to the property
    form/report.

    This occurs on this code:

    Private Sub Form_Load()
    'Make sure we dont display any old readings
    strSQL = "SELECT QRY_Readings.first_name, QRY_Readings.surname,
    QRY_Readings.ParkName, QRY_Readings.PitchNumber, QRY_Readings.Reading_Date,
    QRY_Readings.Electric_Reading, QRY_Readings.Water_Rates,
    QRY_Readings.Water_Rates_Admin, QRY_Readings.Gas_Reading,
    QRY_Readings.Gas_Standing_Charge, QRY_Readings.Street_Lighting FROM
    QRY_Readings where reading_date = #01/01/1980#;"
    SubForm_Invoices.Form.RecordSource = strSQL
    SubForm_Invoices.Form.Requery
    End Sub

    Thanks,
    Simon.

    --
    -
    * Please reply to group for the benefit of all
    * Found the answer to your own question? Post it!
    * Get a useful reply to one of your posts?...post an answer to another one
    * Search first, post later : http://www.google.co.uk/groups
    * Want my email address? Ask me in a post...Cos2MuchSpamMakesUFat!
     
  2. Loading...


  3. tina

    tina
    Expand Collapse
    Guest

    if you've pasted the exact code from your module, i'm surprised it would run
    anywhere. in VBA, a string that runs on more than one line has to be
    concatenated, as

    strSQL = "SELECT first_name, surname, ParkName, " _
    & "PitchNumber, Reading_Date, Electric_Reading, " _
    & "Water_Rates, Water_Rates_Admin, Gas_Reading, " _
    & "Gas_Standing_Charge, Street_Lighting FROM " _
    & "QRY_Readings WHERE reading_date = #01/01/1980#"

    hth


    "Simon Harris" <too-much-spam@makes-you-fat.com> wrote in message
    news:O%23ss7ffkGHA.3936@TK2MSFTNGP05.phx.gbl...
    > Hi All,
    >
    > My code is causing an error on my clients machine, the same code works

    fine
    > for me. The error is as follows:
    >
    > Run-time error '2455':
    > You entered an expression that has an invalid reference to the property
    > form/report.
    >
    > This occurs on this code:
    >
    > Private Sub Form_Load()
    > 'Make sure we dont display any old readings
    > strSQL = "SELECT QRY_Readings.first_name, QRY_Readings.surname,
    > QRY_Readings.ParkName, QRY_Readings.PitchNumber,

    QRY_Readings.Reading_Date,
    > QRY_Readings.Electric_Reading, QRY_Readings.Water_Rates,
    > QRY_Readings.Water_Rates_Admin, QRY_Readings.Gas_Reading,
    > QRY_Readings.Gas_Standing_Charge, QRY_Readings.Street_Lighting FROM
    > QRY_Readings where reading_date = #01/01/1980#;"
    > SubForm_Invoices.Form.RecordSource = strSQL
    > SubForm_Invoices.Form.Requery
    > End Sub
    >
    > Thanks,
    > Simon.
    >
    > --
    > -
    > * Please reply to group for the benefit of all
    > * Found the answer to your own question? Post it!
    > * Get a useful reply to one of your posts?...post an answer to another one
    > * Search first, post later : http://www.google.co.uk/groups
    > * Want my email address? Ask me in a post...Cos2MuchSpamMakesUFat!
    >
    >
     
Since you're here... we have a small favor to ask...

More people are visiting & reading SPN than ever but far fewer are paying to sustain it. Advertising revenues across the online media have fallen fast. So you can see why we need to ask for your help. Donating to SPN's is vote for free speech, for diversity of opinions, for the right of the people to stand up to religious bigotry. Without any affiliation to any organization, this constant struggle takes a lot of hard work to sustain as we entirely depend on the contributions of our esteemed writers/readers. We do it because we believe our perspective matters – because it might well be your perspective, too... Fund our efforts and together we can keep the world informed about the real Sikh Sikhi Sikhism. If everyone who writes or reads our content, who likes it, helps us to pay for it, our future would be much more secure. Every Contribution Matters, Contribute Generously!

    Become a Supporter      ::     Make a Contribution     



Share This Page