none
Help with record source statement RRS feed

  • Question

  • I have the following in the forms open event

     Me.RecordSource = "SELECT IPFeatureChild.ItemNumber, IPFeatureChild.ReOrderItemNumber, IPFeatureChild.ReOrderItemNumber, IPFeatureChild.IPKey,IPFeatureChild.FeatureDescription, IPFeatureChild.PrintLocation, IPFeatureChild.BalloonNumber, IPFeatureChild.Gauge FROM IPFeatureChild ORDER BY IPFeatureChild.BalloonNumber + 0;"

    When the event fires, I get the following error:

    What am I doing wrong?

    Wednesday, January 3, 2018 5:37 PM

Answers

  • Okay, for starters, let's try the following and we can adjust it depending on the result. This will put N/A at the top.

    ORDER BY Val(BalloonNumber)

    Hope it helps...

    • Marked as answer by tkosel Wednesday, January 3, 2018 6:51 PM
    Wednesday, January 3, 2018 6:09 PM

All replies

  • Hi,

    What are you trying to accomplish with the following sorting order?

    ORDER BY IPFeatureChild.BalloonNumber + 0

    The error should go away if you simply use:

    ORDER BY IPFeatureChild.BalloonNumber

    Hope it helps...

    Wednesday, January 3, 2018 5:45 PM
  • As usual, thanks for your input.  I didn't create this originally, just trying to repair it.  I don't know what the original intention was, but the funny thing is that it works for some record sets and doesn't work for others.  If  I remove it, it still seems to work fine.  Will do more testing

    This project has to do with reordering a record set on a field named "Balloon Number"  When it reorders, this is what I get.  How do I get the correct order.  (9 should be at the top, and I am not sure where the N/A should be)

    Wednesday, January 3, 2018 6:06 PM
  • Okay, for starters, let's try the following and we can adjust it depending on the result. This will put N/A at the top.

    ORDER BY Val(BalloonNumber)

    Hope it helps...

    • Marked as answer by tkosel Wednesday, January 3, 2018 6:51 PM
    Wednesday, January 3, 2018 6:09 PM
  • That did it!  Thanks again


     
    Wednesday, January 3, 2018 6:52 PM
  • Hi,

    You're welcome! Glad to hear you got it to work. Good luck with your project.

    Wednesday, January 3, 2018 7:09 PM