Flickering text boxes

MaliciousMike

Registered User.
Local time
Today, 14:29
Joined
May 24, 2006
Messages
118
Hello... again...

I'm having a problem with what looks like a form refresh.

My form has a single drop down box, when that's updated, the whole form is visable and resized etc.

Depending on the criteria in the dropdown box, up to 20 text boxes are updated using a DLookUp.
Everytime something is done (like ticking a checkbox or pressing a button) in the form, the 20 text boxes blink, and it's really... really... REALLY annoying me and my colleagues!

I've tried converting them to labels and using code to update them, but that didn't seem to do the trick.

I could put the info in the query where the form gets its data, but the form is for data entry, which i cannot do with a linked query.

Any help or suggestions would be superb!
 
RuralGuy said:
Have you looked into DoCmd.Echo False?

I put this in my combobox's "AfterUpdate" and it made my access crash... HAH!

Where should i put this?
 
Put it at the beginning of all of the textbox updating and be sure an turn it back on. Look it up in your VBA help system. What version of Access are you using?
 
RuralGuy said:
Put it at the beginning of all of the textbox updating and be sure an turn it back on. Look it up in your VBA help system. What version of Access are you using?

I'm using 2003.

I don't really want to dive into using code for all 20 text boxes.

would it be an idea to turn echo off when the form is opened? and hen turn it back on when the form is closed? or will that defeat the object?

my other option would be to create a subform with a different record source...
 
Have you looked this up in the help system yet? The help system has some cautions. All domain functions are notoriously slow and will slow down your form. What method are you using to cause the TextBoxs to update?
 
RuralGuy said:
Have you looked this up in the help system yet? The help system has some cautions. All domain functions are notoriously slow and will slow down your form. What method are you using to cause the TextBoxs to update?

=DLookUp("[question 1]","Questions","[Company Name]='" & [cmbCompanyName] & "'")

next to these text boxes are checkboxes, once when ticked, all textboxes with DLookUp flicker.
 
They're linked to fields in the record source, so there is none.

The only code that links them both is a whole bunch of If statements (caution, this is messy code, but i'm still in early development):

If IsNull(txtQuestion1) Then
chkQuestion1.Visible = False
txtQuestion1.Visible = False
Else
chkQuestion1.Visible = True
txtQuestion1.Visible = True
txtQuestions = 1
End If


I repeat this for every txtQuestion, from 1 to 20.
 
Sorry for taking so long to get back Mike, but this systems email quit again. Try something like:
Code:
[COLOR="Green"]DoCmd.Echo False[/COLOR]

If IsNull(txtQuestion1) Then
chkQuestion1.Visible = False
txtQuestion1.Visible = False
Else
chkQuestion1.Visible = True
txtQuestion1.Visible = True
txtQuestions = 1
End If
[COLOR="Green"]'-- at the very end if the If...Else...End If sequence
DoCmd.Echo True[/COLOR]
In what event did you put this code?
 
RuralGuy said:
Sorry for taking so long to get back Mike, but this systems email quit again. Try something like:
Code:
[COLOR="Green"]DoCmd.Echo False[/COLOR]

If IsNull(txtQuestion1) Then
chkQuestion1.Visible = False
txtQuestion1.Visible = False
Else
chkQuestion1.Visible = True
txtQuestion1.Visible = True
txtQuestions = 1
End If
[COLOR="Green"]'-- at the very end if the If...Else...End If sequence
DoCmd.Echo True[/COLOR]
In what event did you put this code?

When the cmbbox is updated, it goes to a sub which does all these changes.

so, apart from making the checkboxes visible, it doesn't affect the updating.
 
I'll be back in a couple of hours. Can't you start and end the sub with the Green code? How do you call the sub from the ComboBox?
 
Code:
Private Sub cmbCompanyName_AfterUpdate()

'Me.RecordSource = "SELECT * FROM [qryDataEntry] WHERE [company name] = '" & cmbCompanyName & "'"

Text2 = [cmbCompanyName] & " - Mystery Shop"

Me.Refresh
Me.Caption = [cmbCompanyName] & " - Mystery Shop"

[COLOR="Red"]QuestionTick[/COLOR]
End Sub




Private Sub QuestionTick()

DoCmd.Echo False

If IsNull(txtQuestion1) Then
    chkQuestion1.Visible = False
    txtQuestion1.Visible = False
Else
    chkQuestion1.Visible = True
    txtQuestion1.Visible = True
    txtQuestions = 1
End If

...
...
...

DoCmd.Echo True

End Sub
 
i've given up and taken the easy route out. A subform.

Thanks for your attempts RG!
 
You're welcome. Sorry we didn't succeed. Good luck with the rest of the project.
 
RuralGuy said:
You're welcome. Sorry we didn't succeed. Good luck with the rest of the project.

Thanks.

the project's nearly done actually... this was the last thing to fix before i mass produce a lot of queries and reports etc.
 

Users who are viewing this thread

Back
Top Bottom