Hi,
I've got a userform that uses the .find function to locate a date entered into a combobox (typed if new, selected from the list if it's already in there), and then pull four pieces of data into text boxes (manually entered if the date is new). The problem I'm having is that any time the function successfully finds a date and pulls in the data, it seems to cause a screen updating issues wherein the userform will leave trails across the screen like when you win in solitaire. This form is page two of a four page multiform, each page of which has different dimensions. So when the user finalizes on page two and returns to the main menu, there's this massive block taking up the center of the screen, along with images of message boxes etc. it goes away as soon as you close the form completely. I've posted the code in question below. The actual issue seems to lie with the code that pulls data into the userform - if i comment those lines out, no problem, but also the form becomes useless.
Does anybody happen to know of a solution or workaround for this? Enabling screen updating did not help.
Thanks for taking a look!
I've got a userform that uses the .find function to locate a date entered into a combobox (typed if new, selected from the list if it's already in there), and then pull four pieces of data into text boxes (manually entered if the date is new). The problem I'm having is that any time the function successfully finds a date and pulls in the data, it seems to cause a screen updating issues wherein the userform will leave trails across the screen like when you win in solitaire. This form is page two of a four page multiform, each page of which has different dimensions. So when the user finalizes on page two and returns to the main menu, there's this massive block taking up the center of the screen, along with images of message boxes etc. it goes away as soon as you close the form completely. I've posted the code in question below. The actual issue seems to lie with the code that pulls data into the userform - if i comment those lines out, no problem, but also the form becomes useless.
Does anybody happen to know of a solution or workaround for this? Enabling screen updating did not help.
Thanks for taking a look!
Code:
[FONT=Calibri]Application.ScreenUpdating = True[/FONT][FONT=Calibri]Dim strdate As String, Row As Integer[/FONT]
[FONT=Calibri] strdate = Masterform.ComboBox1.Value[/FONT]
[FONT=Calibri] strdate = Format(strdate, "short date")[/FONT]
[FONT=Calibri] On Error Resume Next[/FONT]
[FONT=Calibri] 'searches DRATES for the date in the combo box. if the date is old, it gets pulled.[/FONT]
[FONT=Calibri] Sheets("DRATES").Activate[/FONT]
[FONT=Calibri]With Worksheets("DRATES").Range("<wbr>G1:G1200")[/FONT]
[FONT=Calibri] Set c = Columns("g").Find(What:=CDate(<wbr>strdate), LookIn:=xlFormulas _[/FONT]
[FONT=Calibri], LookAt:=xlWhole, SearchOrder:=xlByColumns, SearchDirection:=xlNext, MatchCase:=False)[/FONT]
[FONT=Calibri] If Not c Is Nothing Then[/FONT]
[FONT=Calibri] Row = c.Row[/FONT]
[B][FONT=Calibri] With Masterform[/FONT]
[FONT=Calibri] .R1.Value = Sheets("DRATES").Range("H" & Row).Value[/FONT]
[FONT=Calibri] .R6.Value = Sheets("DRATES").Range("I" & Row).Value[/FONT]
[FONT=Calibri] .R11.Value = Sheets("DRATES").Range("J" & Row).Value[/FONT]
[/B][FONT=Calibri][B] .R16.Value = Sheets("DRATES").Range("K" & Row).Value
End With[/B]
[/FONT]
[FONT=Calibri] End If[/FONT]
[FONT=Calibri]End With
[/FONT]