View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Loading values into a form on open.

Sub newdayBtn_Click()
' Application.ScreenUpdating = False
dailyFrm.Load
With Sheets("Data")
dailyFrm.dpr1 = .Cells(25, 3).Value
dailyFrm.dpr2 = .Cells(25, 4).Value
End With
dailyFrm.Show 0
End Sub

--
Regards,
Tom Ogilvy

J. Vandenberg wrote in message
om...
Anyone? Bueller?

(J. Vandenberg) wrote in message

. com...
At the moment I have a form that opens with a button click. It's not a
Private Sub because the button I am using is an autoshape which just
has the macro assigned to it.

Sub newdayBtn_Click()
Application.ScreenUpdating = False
dailyFrm.Show 0 // Tried running it non modal too.

// Then I want it to load values on open into text boxes from cells in
a sheet.

Sheets("Data").Activate
dpr1 = Cells(25, 3)
dpr2 = Cells(25, 4)

// The dpr's are text box names. The thing is, unless I add another
action, ie. tab change, or form click, it will not load the values.

// I thought maybe a repaint would make them show up, but nada. I am
not sure how to initialize the form without a seperate routine, is
there a simple way to make this happen in one click?

Thanks,
-Joel