Jumat, 05 April 2013

[AccessDevelopers] Select Case statement for a list box fails

 

Hello all,

I have a form with a list box based on the database I found called QrySampl. This db has a list box on it and a user chooses from the list box or dbl click the item and the query opens up in design view. I am trying to replicate the form and it bypasses the case statements and nothing happens. I am not sure what is missing here. It seems so straight forward. Below is the code on the button to open the object. I must be missing something. strObjectName and intObjectType are fields in the tblTopicList table.

Thank You for any help on this.

Jim Wagner

Private Sub cmdShowExample_Click()

If Not IsNull(Me![strObjectName]) Then

Select Case Me![intObjectType]

Case 1
DoCmd.OpenQuery Me![strObjectName], acViewDesign

Case 2
DoCmd.OpenForm Me![strObjectName], acPreview

Case 3
DoCmd.OpenReport Me![strObjectName], acViewDesign

End Select

Else
MsgBox "No Name in table"
End If

End Sub

__._,_.___
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (1)
Recent Activity:

Please zip all files prior to uploading to Files section.
.

__,_._,___

Tidak ada komentar:

Posting Komentar