Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have created a form which contains persons details, along
with other information. I would like to store the person's details into a database. I would also like to be able to set the form up to query the database everytime the person's surname is entered, to see if the person is already in the database. I would then like to import the person details back in, if they are already in the database(save typing it all out again). Is this possible in Excel. (I know this is more of an Access type function, but I have even less knowledge of Access.) I have tried searching other sites but can't seem to find anything that will walk me through this. Thanks .. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Tim
You can certainly do this. Make sure your sheet with the data is set up like a database, i.e. fields and records. Then, I presume, you will have a textbox on the form in which the user will type the surname. You can FIND the surname on the sheet and populate other controls on the form with the information. Here's the basic construct. Dim FndRng as Range Set FndRng = Sheets("Data").UsedRange.Columns(1).Find(Me.TextBo x1.Text,,xlWhole) If Not FndRng Is Nothing Then 'Surname found Me.TextBox2.Text = FndRng.Offset(0,1).Value Me.TextBox3.Text = FndRng.Offset(0,2).Value 'etc. End If Then, to write back to the database, do the same thing, with a provision for new records. 'same Dim and Set as above If FndRng Is Nothing Then 'Surname not found so new record Set FndRng = Sheets("Data").Range("A65536").End(xlUp).Offset(1, 0) End If FndRng.Offset(0,1).Value = Me.TextBox2.Text 'etc... -- Dick Kusleika MVP - Excel www.dicks-clicks.com Post all replies to the newsgroup. "Tim" wrote in message ... I have created a form which contains persons details, along with other information. I would like to store the person's details into a database. I would also like to be able to set the form up to query the database everytime the person's surname is entered, to see if the person is already in the database. I would then like to import the person details back in, if they are already in the database(save typing it all out again). Is this possible in Excel. (I know this is more of an Access type function, but I have even less knowledge of Access.) I have tried searching other sites but can't seem to find anything that will walk me through this. Thanks . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Import New Database Query (Union Query) in Spreadsheet | Excel Discussion (Misc queries) | |||
database query not showing foxpro database How I import data | New Users to Excel | |||
Anyone Else Use Database Query to Query Another Sheet in the Same Excel Workbook? | Excel Discussion (Misc queries) | |||
Anyone Else Use Database Query to Query Another Sheet in the Same Excel Workbook? | Excel Discussion (Misc queries) | |||
How to use a Access Query that as a parameter into Excel database query | Excel Discussion (Misc queries) |