|
-
Jul 13th, 2006, 08:42 PM
#16
Thread Starter
New Member
Re: refresh/go
how i understand it is that my code for the search button should be as follows
VB Code:
Private Sub cmdSearch_Click()
Dim rsFind As ADODB.Recordset
Dim strSQL As String
'** set up strSQL here
strSQL = "SELECT * FROM tb1_master"
If Combo2.Text <> "" Then
strSQL = strSQL & " WHERE stock code = " & Val(Combo2.Text)
End If
rsFind.Open strSQL, cn, adOpenForwardOnly, adLockReadOnly, adCmdText
'** fill the controls here
rsFind.Close
Set rsFind = Nothing
but will this work how i want for example
my database comprises 4 columns (not really but for examplery purposes)
first column is supplier code
second column stock code
third column item code
and fourth column description
there are thousands of items each one has the exact same supplier code (eg 160)
so if i search the supplier code column for 160 i will get 1000 matches but it will only say 160 over and over again right?
i want it to show me the stock codes that are stored within that supplier(160) in the (newly created/adjusted) combo box(instead of text box this way it will show me all stock codes if i click the drop button that are in that supplier) i can then choose a stock code(eg 45,46 or 47) each of these stock codes contain 10 items each of those items have and item code (individual products of an item type) for our purposes those codes are 1 - 10 (ie full code on a product on shelves reads 160,45,1 or 160,47,1)i choose a item number and click our search button (for the third time one click for each search i have searched the supplier codes, the stock codes and now the item codes)the text box on the right of the screen should show me a description of that individual item is that what this coding should help do
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
|