Advertisement

06.05.2008 at 02:05AM PDT, ID: 23459464
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

9.6

Refreshing combo box on datasheet  view loosing information in previous records

Asked by loymartina in Access Forms

Tags: , ,

Hi

I have 3 combo boxes on a subform: Product, Stock, part Number
Depending on the selection of the first two the record source of the part number combo box is change to filter records.  This works ok.  The problem is if I enter a second record on the subform (in datasheet view) the record that was entered in the first row loses its data in the part number combo box.  

This is the code I use to refresh the combo box;

Private Sub cboRVNumber_Enter()


    Dim sql As String
   
If IsNull(Me.cboProductType.Column(1)) = False And IsNull(Me.cboStockType.Column(1)) = True Then
        sql = "SELECT tblStock.stockId, tblStock.rvNumber, tblStock.description,tblProductType.productType " & _
              "FROM tblProductType INNER JOIN tblStock ON tblProductType.productTypeID = tblStock.productType " & _
              "WHERE tblProductType.productType='" & Me.cboProductType.Column(1) & "'"
    ElseIf IsNull(Me.cboProductType.Column(1)) = True And IsNull(Me.cboStockType.Column(1)) = False Then
        sql = "SELECT tblStock.stockId, tblStock.rvNumber, tblStock.description,tblStockTypes.stockType " & _
              "FROM tblStockTypes INNER JOIN tblStock ON tblStockTypes.stockTypeID = tblStock.stockType " & _
              "WHERE tblStockTypes.stockType='" & Me.cboStockType.Column(1) & "'"
    ElseIf IsNull(Me.cboProductType.Column(1)) = False And IsNull(Me.cboStockType.Column(1)) = False Then
        sql = "SELECT tblStock.stockId, tblStock.rvNumber, tblStock.description,tblProductType.productType, tblStockTypes.stockType " & _
              "FROM tblStockTypes INNER JOIN (tblProductType INNER JOIN tblStock ON " & _
              "tblProductType.productTypeID = tblStock.productType) ON tblStockTypes.stockTypeID = tblStock.stockType " & _
              "WHERE tblProductType.productType= '" & Me.cboProductType.Column(1) & "' AND tblStockTypes.stockType='" & Me.cboStockType.Column(1) & "'"
    Else
        sql = "SELECT tblStock.stockId, tblStock.rvNumber FROM tblStock"
    End If
   
    cboRVNumber.RowSource = sql
    cboRVNumber.Requery
End Sub

Can anyone help with this please?

ThanksStart Free Trial
[+][-]06.05.2008 at 03:08AM PDT, ID: 21717704

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.05.2008 at 03:27AM PDT, ID: 21717799

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.05.2008 at 05:19AM PDT, ID: 21718455

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Access Forms
Tags: Microsoft, Access, xp
Sign Up Now!
Solution Provided By: MikeToole
Participating Experts: 1
Solution Grade: A
 
 
[+][-]06.05.2008 at 06:20AM PDT, ID: 21719017

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628