Solved

Suppress Graph Datasheet Popup

Posted on 2013-01-18
15
299 Views
Last Modified: 2013-01-20
Hello Experts,

I am updating a graph on a form from data entered in a text box.

It is being updated dynamically by requerying in the gotfocus  event.

Problem is that when its being updated the the datasheet pops up and i don' want the end user to see it.

Is there a way tu suppress it?

Thanks
0
Comment
Question by:SweetingA
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 9
  • 6
15 Comments
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 500 total points
ID: 38794727
0
 

Author Comment

by:SweetingA
ID: 38794910
Not really sure what you have done exactly as the graph does not show up at all.

I modified the one from yesterday a little - see attached.

When you change the result you will see the problem i have (datasheet annoyingly pops up)

the reason i am playing around with the format a little is because the message box is in an annoying place and when i enter yes i also get the focus stuck in the subform and i can't find any way to position the message box unless i make my own which seems a little stupid.

Regards
TargetTrackingREV.mdb
0
 

Author Comment

by:SweetingA
ID: 38796999
Hi Capricorn 1,

Could you also explain why you set the rowrource equal to itself?

Not sure what that is aiming to do.

Thanks
0
Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 38797052
that is another way of (forcing) a requery of the graph.
0
 

Author Comment

by:SweetingA
ID: 38797069
i see but the graph no longer shows without clickin on it and off it again?
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 38797100
see if the Activate property of the graph is set on focus
0
 

Author Comment

by:SweetingA
ID: 38797138
The auto activate is set on getfocus but you commented out the requery in the on focus event , was that intentional?
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 38797154
yes
0
 

Author Comment

by:SweetingA
ID: 38797166
Hi Capricorn1,

I think there are now two issues with the script

1. the graph does not automatically display (white square)
2. when i force the graph to dispaly and update the result on the form, the subform updates but the graph does not refresh

previously...

1. the graph used to display automatically
2. the graph updated when the result was changed but the graphs datasheet displyed which was increbibly annoying

Thanks for your patience
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 38797728
sweetingA,
i  don't know what to say, it is working perfectly ok here, using  windows 7 ultimate, tested in A2007 and A2010
0
 

Author Comment

by:SweetingA
ID: 38798858
Hi Capricorn1,

I have tested it on another computer with XP and A2007.

Graph now displays but when i update the result the graph does still not update until i leave the record and re-enter the record.

Regards
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 38798892
you may need to save the record first

try adding

me.dirty=false 'add this line
me.graph1.setfocus

me.graph1.rowsource=me.graph1.rowsource
0
 

Author Comment

by:SweetingA
ID: 38798980
the test system i normally use is windows 7 and A2003 which highlights both issues
0
 

Author Comment

by:SweetingA
ID: 38798998
Hi Capricorn1,

The atatched code now works but only 1 very small annoyance.

Whe i update results, the datasheet for the graph flashes on the sceen for a moment while its being updated and then dissappears as i shift the focus.

I will award the points anyway for all your help but is there any chance to stop it flashing on the screen?

Thanks

Option Compare Database

Private Sub Command42_Click()
'Form_frm_PDM_Targets.DataEntry = True
Forms!frm_PDM_Targets.DataEntry = True
End Sub

Private Sub Form_Load()
On Error GoTo Err_NewRecord_Click

DoCmd.GoToRecord , , acLast
DoCmd.GoToRecord , , acNext
Me.Year.SetFocus
Me.frm_PDM_Results_subform.Visible = False
Me.SubformLabel.Visible = False
Me.Graph1.Visible = False

Exit_NewRecord_Click:
    Exit Sub

Err_NewRecord_Click:
    MsgBox Err.Description
    Resume Exit_NewRecord_Click
End Sub

Private Sub Form_Current()
    Me.Measure.Requery
    Me.Unit.Requery
    Me.[Sort Criteria] = Me.Year & Me.Period & Me.Measure
    Me.[Sort Criteria 2] = Me.Year & Me.Measure
    Me.[Sort Criteria 3] = Me.Year - 1 & Me.Period & Me.Measure
End Sub

Private Sub Year_AfterUpdate()
    If IsNull(Year) Then
        MsgBox ("Enter Year")
        Me.Period.Locked = True
        Me.Year.SetFocus
    Else:
        Me.Period.Locked = False
    End If
End Sub

Private Sub Period_AfterUpdate()
    If IsNull(Period) Then
        MsgBox ("Enter Period")
        Me.Project_Category.Locked = True
        Me.Period.SetFocus
    Else:
        Me.Project_Category.Locked = False
    End If
End Sub

Private Sub Project_Category_AfterUpdate()
    Me.Measure.Requery
    If IsNull(Project_Category) Then
        MsgBox ("Enter Project_Category")
        Me.Measure.Locked = True
        Me.Project_Category.SetFocus
    Else:
        Me.Measure.Locked = False
    End If
End Sub

Private Sub Measure_AfterUpdate()
    Dim a As String
    Dim b As String
    Dim c As String
    Dim d As String
    Dim e As String
    Me.Unit.Requery
    Me.[Sort Criteria] = Me.Year & Me.Period & Me.Measure
    Me.[Sort Criteria 2] = Me.Year & Me.Measure
    Me.[Sort Criteria 3] = Me.Year - 1 & Me.Period & Me.Measure
    a = DLookup("[Unit]", "tbl_PDM_TargetProjects", "[Measure]=Forms!frm_PDM_Results.Measure")
    b = DCount("[Sort Criteria]", "tbl_PDM_Results", "[Sort Criteria] = Forms!frm_PDM_Results.[Sort Criteria]")
    c = DCount("[Result]", "tbl_PDM_Results", "[Sort Criteria]=Forms!frm_PDM_Results.[Sort Criteria 3]")
    If c >= 1 Then
        d = DLookup("[Result]", "tbl_PDM_Results", "[Sort Criteria]=Forms!frm_PDM_Results.[Sort Criteria 3]")
        Me.PYR = d
        strSQL = "UPDATE tbl_PDM_Results" & " SET tbl_PDM_Results.[Previous Year Result] = " & d & " WHERE [Sort Criteria] = Forms!frm_PDM_Results.[Sort Criteria 3]"
        With DoCmd
            .SetWarnings False
            .RunSQL strSQL
            .SetWarnings True
        End With
    End If
    If b = 0 Then
        If IsNull(Measure) Then
            MsgBox ("Enter Measure")
            Me.Result.Locked = True
            Me.Measure.SetFocus
        Else:
            Me.Unit = a
            Me.Result.Locked = False
            CurrentDb.Execute "delete * from tbl_PDM_Results WHERE [Result] is NULL"
            Me.frm_PDM_Results_subform.Visible = True
            Me.SubformLabel.Visible = True
            Me.Graph1.Visible = True
        End If
    Else:
        e = MsgBox("Record exists, do you want to update an existing record?", vbYesNo + vbQuestion, "Important Message!")
        If e = vbNo Then
            Me.Year = Null
            Me.Period = Null
            Me.Project_Category = Null
            Me.Measure = Null
            Me.Unit = Null
            Me.Sort_Criteria = Null
            Me.[Sort Criteria] = Null
            Me.[Sort Criteria 2] = Null
            Me.[Sort Criteria 3] = Null
            Me.Year.SetFocus
        ElseIf (e = vbYes) Then
            With Me.RecordsetClone
            .FindFirst "[Sort Criteria]='" & Me.[Sort Criteria] & "'"
            If Not .NoMatch Then
                Me.Bookmark = .Bookmark
            Else
                MsgBox "Record not found"
            End If
            End With
            CurrentDb.Execute "delete * from tbl_PDM_Results WHERE [Result] is NULL"
            Me.frm_PDM_Results_subform.Visible = True
            Me.SubformLabel.Visible = True
            Me.Graph1.Visible = True
            Me.Graph1.SetFocus
            Me.Graph1.RowSource = Me.Graph1.RowSource
            Me.Result.SetFocus
        End If
    End If
    Me.Result.SetFocus
    Call LeftClick
End Sub

Private Sub Result_AfterUpdate()
    Me.Dirty = False
    Me.Graph1.SetFocus
    Me.Graph1.RowSource = Me.Graph1.RowSource
    Me.Dirty = False
    Me.Year.SetFocus
End Sub

Private Sub Form_Close()
On Error GoTo Err_Exit_Click

CurrentDb.Execute "delete * from tbl_PDM_Results WHERE [Result] is NULL"

Exit_Exit_Click:
    Exit Sub

Err_Exit_Click:
    MsgBox Err.Description
    Resume Exit_Exit_Click
End Sub
0
 

Author Closing Comment

by:SweetingA
ID: 38799578
I will add a seperate question about the datasheet flashing up on the screen during updated
0

Featured Post

Enroll in May's Course of the Month

May’s Course of the Month is now available! Experts Exchange’s Premium Members and Team Accounts have access to a complimentary course each month as part of their membership—an extra way to increase training and boost professional development.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Omit After Update event 5 45
managing events in  the webrowser control 14 66
Handle Apostrophes in VBA SQL - Part 2 10 47
Combo box question 6 54
In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
AutoNumbers should increment automatically, without duplicates.  But sometimes something goes wrong, and the next AutoNumber value is a duplicate.  This article shows how to recover from this problem.
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question