Getting sheet to find data

G

Guest

Hi everyone
I'm designing a meeting room booker and I have created a form for users to
interact with. On the form is a date/time picker, a hidden text box and
several labels.
The idea is this: the user chooses the date, the text box fills with the
chosen date from the date picker. Using the date in the text box, the labels
(each representing a time slot) retrieve the value of a cell in a worksheet
(where all the data will be stored) corresponding to the relevant date.

However, it falls fown when trying to find the row relevant to the date they
are searching for...

Private Sub btnCheck_Click()
z = 1
Do Until Sheet1.Cells(z, 1) = txtDate.Value
z = z + 1
Loop
frmBooker.lbl8slot.Caption = Sheet1.Cells(z, 2)
End Sub

I get a runtime error 1004. Any help would be gratefully appreciated.

Thanks
Dan
 
J

Jim Cone

Dan,

Dim z as Long
'--
Do Until Me.Cells(z, 1).Text = Me.Shapes("txtDate").TextFrame.Characters.Text
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware


"Dan V" <Dan (e-mail address removed)>
wrote in message
Hi everyone
I'm designing a meeting room booker and I have created a form for users to
interact with. On the form is a date/time picker, a hidden text box and
several labels.
The idea is this: the user chooses the date, the text box fills with the
chosen date from the date picker. Using the date in the text box, the labels
(each representing a time slot) retrieve the value of a cell in a worksheet
(where all the data will be stored) corresponding to the relevant date.

However, it falls fown when trying to find the row relevant to the date they
are searching for...

Private Sub btnCheck_Click()
z = 1
Do Until Sheet1.Cells(z, 1) = txtDate.Value
z = z + 1
Loop
frmBooker.lbl8slot.Caption = Sheet1.Cells(z, 2)
End Sub

I get a runtime error 1004. Any help would be gratefully appreciated.

Thanks
Dan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top