Advertisement

05.02.2008 at 12:21AM PDT, ID: 23370905
[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!

8.5

Microsoft, Access 2003 VBA, Requery not refreshing for Null values in Combo

Asked by dave1f in Access Coding/Macros, Microsoft Access Database, Visual Basic Programming

Tags: , , , ,

Hi, I am new to Access 2003 VBA, new to programming and born BC (Before Computers). I would appreciate if anybody can tell me why the Requery in this code works fine for the "ELSE" part but not for the "IF" part. The query (My_Query) is updated in both cases and if I open the form "sfrmOpenItemDatasheet" manually after the query was run then it works OK.

Any help will be appreciated.

Dave

Private Sub cboMeetingType_Click()

Dim strMeetingType As String
Dim sqltext As String
Dim qdfNew As DAO.QueryDef

strMeetingType = Me![cboMeetingType].Value & ""
If ([strMeetingType] = "") Then
    sqltext = "SELECT [Open Item].Nr, [Open Item Type].Nr, [Open Item Type].[Code 1], [Open Item].Type, [Open Item].Responsible, " & _
    "[Open Item].[Due Date], [Open Item].[Date Done], [Open Item].Title, Employees.Nr, Employees.Initials, [Open Item].SNr," & _
    "[Open Item].[Open Item] & '-' & [Open Item].[Ref Nr] AS OpenItemFull " & _
    "FROM [Open Item Type] RIGHT JOIN (Employees RIGHT JOIN [Open Item]" & _
    "ON Employees.Nr = [Open Item].Responsible) ON [Open Item Type].Nr = [Open Item].Type " & _
    "ORDER BY [Open Item].Nr;"
   
    With CurrentDb
    'is run for the first time it would be better to check to see if the querydef exists and then delete it
   .QueryDefs.Delete ("My_Query")
    '  createquerydef command line follows
     
     Set qdfNew = .CreateQueryDef("My_Query", sqltext)
    'the recordsource of the report is called My_Query.
     [Forms]![frmOpenItemMain].[Form]![sfrmOpenItemDatasheet].Requery
     .Close
    End With
   
Else

    sqltext = "SELECT [Open Item].Nr, [Open Item Type].[Code 1], [Open Item].[Due Date], [Open Item].[Date Done]," & _
    "[Open Item].Title , Employees.Initials, [Open Item].SNr, [Open Item].[Open Item] & '-' & [Open Item].[Ref Nr]" & _
    "AS OpenItemFull " & _
    "FROM [Meeting Type] RIGHT JOIN ([Open Item Type] RIGHT JOIN (Employees RIGHT JOIN [Open Item]" & _
    "ON Employees.Nr=[Open Item].Responsible) ON [Open Item Type].Nr=[Open Item].Type)" & _
    "ON [Meeting Type].Nr=[Open Item].[Meeting Type]" & _
    "WHERE ((([Meeting Type].Description) = Forms!frmOpenItemMain!sfrmOpenItemFilter.Form![cboMeetingType]))" & _
    "ORDER BY [Open Item].Nr;"
   
    With CurrentDb
    '  is run for the first timeit would be better to check to see if the querydef exists and then delete it
   .QueryDefs.Delete ("My_Query")
     '  createquerydef command line follows
     
    Set qdfNew = .CreateQueryDef("My_Query", sqltext)
    'the recordsource of the report is called My_Query.
    [Forms]![frmOpenItemMain].[Form]![sfrmOpenItemDatasheet].Requery
    .Close
    End With
End If
End SubStart Free Trial
 
Loading Advertisement...
 
[+][-]05.02.2008 at 01:15AM PDT, ID: 21485192

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.

 
[+][-]05.02.2008 at 01:34AM PDT, ID: 21485250

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.

 
[+][-]05.02.2008 at 01:45AM PDT, ID: 21485293

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.

 
[+][-]05.02.2008 at 01:49AM PDT, ID: 21485307

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.

 
[+][-]05.02.2008 at 02:01AM PDT, ID: 21485345

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.

 
[+][-]05.02.2008 at 02:14AM PDT, ID: 21485384

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.

 
[+][-]05.02.2008 at 02:16AM PDT, ID: 21485391

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.

 
[+][-]05.02.2008 at 02:22AM PDT, ID: 21485402

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.

 
[+][-]05.02.2008 at 03:09AM PDT, ID: 21485555

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.

 
[+][-]05.02.2008 at 04:26AM PDT, ID: 21485768

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.

 
[+][-]05.02.2008 at 04:36AM PDT, ID: 21485806

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.

 
[+][-]05.02.2008 at 05:01AM PDT, ID: 21485917

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.

 
[+][-]05.02.2008 at 05:06AM PDT, ID: 21485952

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.

 
[+][-]05.02.2008 at 05:16AM PDT, ID: 21486009

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.

 
[+][-]05.02.2008 at 05:21AM PDT, ID: 21486038

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.

 
[+][-]05.03.2008 at 09:40PM PDT, ID: 21494582

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.

 
[+][-]05.03.2008 at 09:48PM PDT, ID: 21494594

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

Zones: Access Coding/Macros, Microsoft Access Database, Visual Basic Programming
Tags: Microsoft, Access 2003 VBA, 2003, Access 2003 VBA, Firefox 2.0
Sign Up Now!
Solution Provided By: ldunscombe
Participating Experts: 2
Solution Grade: A
 
 
[+][-]05.03.2008 at 11:38PM PDT, ID: 21494752

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