#1   Report Post  
bern
 
Posts: n/a
Default User Form Coding


Hi All
Could somebody look at my coding (below)
I have a user form that makes appointsments by adding data to a booking
sheet. That works fine. But I have also have a command button to open
another form to cancel or reshedule the appointments. In order to find
a client and the appointment details I use the below code. But I can't
seem to get it to work. Any help please.

Appoitment worksheet
A..........B...........C................D......... .............E..........F........G.....H
custID..Surname..First Name..Contact
number..Salon..Date..Time..Treatment

Bookings worksheet
A..........B...........C................D......... .............E..........F........G.....H
custID..Surname..First Name..Contact
number..Salon..Date..Time..Treatment

Private Sub txbcustid_KeyDown(ByVal KeyCode As MSForms.ReturnInteger,
ByVal Shift As Integer) 'tab key
Application.ScreenUpdating = False
Dim myclient
If KeyCode = "9" Or KeyCode = "13" Then
With frmReshedule
myclient = .txbsurname
On Error Resume Next
Cells.Find(What:=myclient, lookat:=xlWhole).Activate
If Err = 91 Then
MsgBox "Sorry could not find ClientId :" & myclient
.txbsurname = ""
.txbsurname.SetFocus
Application.SendKeys "+{tab 1}", True
Exit Sub
End If
.txbcustid.Value = ActiveCell.Offset(, 0).Text
.txbfirstname.Value = ActiveCell.Offset(, 2).Text
.txbcontactnumber.Value = ActiveCell.Offset(, 3).Text
.txbsalon.Value = ActiveCell.Offset(, 4).Text
.txbdate.Value = ActiveCell.Offset(, 5)
.txbtime.Value = ActiveCell.Offset(, 6)
.txbtreatment.Value = ActiveCell.Offset(, 7).Text
End With
End If
End Sub

Bern


--
bern
------------------------------------------------------------------------
bern's Profile: http://www.excelforum.com/member.php...o&userid=20169
View this thread: http://www.excelforum.com/showthread...hreadid=437491

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Print scrollable user form. cparsons Excel Discussion (Misc queries) 2 August 4th 05 04:45 PM
User Form to Mail Merge mully New Users to Excel 0 May 24th 05 11:45 AM
user form static69 Excel Discussion (Misc queries) 1 February 6th 05 08:43 PM
Data Entry Alert in User Form Kev Excel Discussion (Misc queries) 6 January 8th 05 03:01 PM
A "previous" button on a user form Anthony Slater Excel Discussion (Misc queries) 3 November 29th 04 05:57 PM


All times are GMT +1. The time now is 12:49 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"