Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Suppress Graph Datasheet Popup

Posted on 2013-01-18
15
Medium Priority
?
314 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 2000 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

Question has a verified solution.

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

It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
Traditionally, the method to display pictures in Access forms and reports is to first download them from URLs to a folder, record the path in a table and then let the form or report pull the pictures from that folder. But why not let Windows retr…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

610 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