Filling the empty rows on the basis of diffrent Column

suji

New Member
Joined
Oct 12, 2009
Messages
12
Hi <?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:eek:ffice:eek:ffice" /><o:p></o:p>
<o:p></o:p>
I am so thankful to the people who are supporting us in solving our issues...<o:p></o:p>
I am stuck with the below tool...please support me in making it work...<o:p></o:p>
<o:p></o:p>
I am creating a excel tool which is linked with access database. <o:p></o:p>
in "Col B" or "Col C" sales team will enter their product IDs and then they will click the button "Get Details", Now on the basis of the either one column the excel ie B or C VBA code should get the details from Access Database like its discount ok,no discout,see massage etc in "Col E".<o:p></o:p>
There will be some Product ID not in Database in that case the Col E pertaining to the Product to show "NOT Found" and additional message should show in "COl F" as "Contact Mgr".<o:p></o:p>
<o:p></o:p>
I can only use DAO code to integrate Excel and Access...<o:p></o:p>
<o:p></o:p>
Please help me with the sample code so that I can fix it...<o:p></o:p>
<o:p></o:p>
Thanks a ton in Advance<o:p></o:p>
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
Hi Denis...<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:eek:ffice:eek:ffice" /><o:p></o:p>
<o:p></o:p>
Thanks a lot for the response....<o:p></o:p>
Yes - the link is really helpful...<o:p></o:p>
Now I am stuck at 2 places...Please guide me here as well...<o:p></o:p>
<o:p></o:p>
1. I successfully wrote the code to get the data from access...but there are some product ids that do not have details in access database for that the corresponding columns should throw the result as "No Information" in next row " contact manager".<o:p></o:p>
Is there any way we can do that.<o:p></o:p>
<o:p></o:p>
2. We have some Product IDs with * (wild card) such as "ACC-DEC-*" , "BOW-COM-*","EWSA*" etc.....(this Ids are in Access Database).....Is there are way to write DAO code to identify the product ids in excel such as "ACC-DEC-1234" and match it with the database and get the data pertaining to in the excel....<o:p></o:p>
<o:p></o:p>
<o:p></o:p>
<o:p></o:p>
These are very crucial issues i am trying to solve desperately from couple<o:p></o:p>
of days buy not getting success.....Please guide me soon.....<o:p></o:p>
<o:p></o:p>
<o:p></o:p>
Thanks a lot in advance.....<o:p></o:p>
Suji
 
Upvote 0
For the wild cards, the criteria need to change slightly.
For example, an exact match would be something like WHERE Somefield = 'ABC'
A wildcard match would be something like WHERE Somefield LIKE 'ABC%'

(In ADO you use % instead of * for wildcards).

Denis
 
Upvote 0
HI Denis ..Thank you for the reply....

This is how i am wrting the code but i am not able to get the data in Excel....Please let me know where i am making mistake....

Set rs = dbconn.OpenRecordset("Select * from [TestData_ETIF_08-1 Query] where [Product ID] like '*ABC-*'")

Set rs = dbconn.OpenRecordset("Select * from [TestData_ETIF_08-1 Query] where [Product ID] = '" & xlws.Range("B6").Value & "'")

For Row_Number = 1 To 300

Excel_Product_Id = xlws.Cells(Row_Number + 7, 2).Value
Set rs = dbconn.OpenRecordset("Select * from [TestData_ETIF_08-1 Query] where [Product ID] ='" & Excel_Product_Id & "'")



xlws.Cells(Row_Number + 7, 15).CopyFromRecordset rs

Next

rs.Close



Please wirte to me soon as i am stuck at this p[oint from long time....


Thanks a Ton...
Suji
 
Upvote 0

Forum statistics

Threads
1,214,893
Messages
6,122,121
Members
449,066
Latest member
Andyg666

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top