LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Userform lookup date value in database


Hi,

Trying to resolve a problem when trying to populate TextBox field
after data has been entered into TextBox1 field in a Userform.

The data entered in TextBox1 is a date dd/mm/yyyy and is stored i
sheet Dbase as "Text" ( have tried many different options Date
General, Text ) but continue to either not match it or get erro
messages "Type mismatch Error 13 at code Loc = TextBox1.Value )

My code is as follows : ( any suggestions )

Private Sub TextBox1_AfterUpdate()
Dim Loc As Long
Sheets("Menu").Select
res = Application.Match(TextBox1.Value
Worksheets("Dbase").Range("A:A"), 0)
If IsError(res) Then
Exit Sub
Else
End If
Loc = TextBox1.Value
With Worksheets("Dbase")
Set C = .Range("A:A").Find(Loc, LookIn:=xlValues)
TextBox2 = .Cells(C.Row, 2)
TextBox4 = .Cells(C.Row, 3)
TextBox5 = .Cells(C.Row, 4)
TextBox6 = .Cells(C.Row, 5)
TextBox7 = .Cells(C.Row, 6)
TextBox8 = .Cells(C.Row, 7)
TextBox9 = .Cells(C.Row, 8)
TextBox10 = .Cells(C.Row, 9)
TextBox11 = .Cells(C.Row, 10)
TextBox13 = .Cells(C.Row, 12)

If .Cells(C.Row, 11) = "F" Then
OptionButton2.Value = True
OptionButton3.Value = False
Else
OptionButton3.Value = True
OptionButton2.Value = False
End If

End With

End Sub

Cheers,
Bern

--
Bernz
-----------------------------------------------------------------------
BernzG's Profile: http://www.excelforum.com/member.php...fo&userid=2294
View this thread: http://www.excelforum.com/showthread.php?threadid=37694

 
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
multiple database lookup David Macdonald Excel Discussion (Misc queries) 1 February 2nd 10 01:50 PM
Database Lookup Modawg Excel Worksheet Functions 2 August 25th 09 01:24 PM
lookup database ellebelle Excel Worksheet Functions 3 October 13th 08 09:17 AM
Code to 'lookup' value in Access database maacmaac Excel Discussion (Misc queries) 0 September 16th 05 02:52 AM
Database Lookup Raymond Gallegos Excel Worksheet Functions 1 December 22nd 04 01:44 AM


All times are GMT +1. The time now is 03:37 AM.

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

About Us

"It's about Microsoft Excel"