SQL-VB Enter Parameter Value Issue

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • n3ox3ro
    New Member
    • Jun 2007
    • 2

    #1

    SQL-VB Enter Parameter Value Issue

    For my visual Basic code i have...

    Private Sub Command459_Clic k()
    On Error Resume Next
    DoCmd.OpenForm "view_Obs", acNormal, "ByObsNumbe r"
    End Sub

    and for my 'ByObsNumber' querry i have ...

    SELECT main.*, main.ID
    FROM main
    WHERE (((main.ID)=[Type in Observation Number]))


    the issue come in when if it is pulling a record from the 'main' table. if no such record exists then the entire form goes blank.

    How do i fix it to where it cancels if no record found or go to next available record??
Working...