|
-
Jan 14th, 2005, 06:02 PM
#1
Thread Starter
Addicted Member
Database Programming
Ok. Here is my problem.
I need to have the user perform a search (eg. last name).
Let's say they type in smith as the last name. I got this part ok, what I want is if there are 5 smiths, they can choose one and go to the customer properties to change information.
So my question is, what is the best control to use to retrieve search data and allow the user to click on the desired result and have the customer properties open with all the customer information?
Things fall apart which the center cannot hold...
-
Jan 14th, 2005, 08:43 PM
#2
Re: Database Programming
There aint any controls for that purpose - you'd have to code it yourslef.
General idea is as follows:
- open connection
- construct sql statement such "Select * From Customers Where Last_Name Like 'Smit%'"
- open recordset based on your sql
- populate all necessary controls (grid, textboxes, etc ...)
-
Jan 15th, 2005, 10:00 AM
#3
Thread Starter
Addicted Member
Re: Database Programming
what i am getting at is, after running a query and populating the datagrid with the results, how do i populate text boxes based on what result was clicked on from the datagrid.
Things fall apart which the center cannot hold...
-
Jan 15th, 2005, 10:32 AM
#4
Re: Database Programming
Which datagrid are you using? There are two: one is Data Bound Grid (DBGrid) and second is Data Grid (DataGrid).
-
Jan 16th, 2005, 12:46 PM
#5
Thread Starter
Addicted Member
Things fall apart which the center cannot hold...
-
Jan 16th, 2005, 02:45 PM
#6
Re: Database Programming
Oh, ok. In that case all you'll need to do (after search is completed) is something similar to the following:
VB Code:
Private Sub DataGrid1_RowColChange(LastRow As Variant, ByVal LastCol As Integer)
Text1.Text = Adodc1.Recordset!ID
End Sub
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|