Sign in to follow this  

I'll need help with office access 2003 programming.

This topic is 4718 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm having a problem with Microsoft Office Access 2003 Programming, everytime I select Combo Box a pop up window asking for a value parameter for that table too get the value specific. I want to get rid-off that value parameter pop-up window. Can somebody help me? Please!
Option Compare Database
Option Explicit

Private Const strSQL1 = "SELECT Size, Shape, Material " & _
    "FROM qryCombo1 Where Size = '"
Private Const strSQL2 = "' AND Shape = "
Private strSQL As String

Private Const strMsg1 = "Select a Size from the list"
Private Const strMsg2 = "Select a Shape from the list"

Private Sub FillList()
strSQL = strSQL1 & Me!cboSize.Value & _
    strSQL2 & Me!cboShape.Value
Me!lstOrders.RowSource = strSQL
Me!lstOrders.Requery
Me!lblList.Caption = "Orders from " & _
Me!cboSize.Value & " for " & _
Me!cboShape.Column(1)
If Me!lstOrders.ListCount = 0 Then
    Me!lblList.Caption = "No " & Me!lblList.Caption
End If
End Sub

Private Sub cboSize_AfterUpdate()
If Me!cboShape.Value <> "" Then
    Call FillList
Else
    Me!lblList.Caption = strMsg1
End If
End Sub

Private Sub cboShape_AfterUpdate()
If Me!cboSize.Value > 0 Then
    Call FillList
Else
    Me!lblList.Caption = strMsg2
End If
End Sub

Private Sub Form_Activate()
If Me!cboSize.Value > 0 And Me!cboShape.Value <> "" Then
    Call FillList
Else
    Me!lblList.Caption = strMsg2
End If
End Sub

Thank you!

Share this post


Link to post
Share on other sites

This topic is 4718 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this