UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> Batch Parameter Search For A Query, Access 2016    
 
   
mir4ge
post Aug 14 2019, 07:30 AM
Post#1



Posts: 5
Joined: 14-March 19



So, I have a question (which I hope I can explain thoroughly). I'm wondering if there is a way to import a csv file that contains either UserIDs, Workstation IDs, and/or Email Addresses and have a query spit out the results. The CSV is always only going to have one of the 3, they will never have all 3 in the same file. I'm hoping there is a simple way to do a batch search. So, if my CSV file contains the UserIDs:

AAA12
AAA13


Then the following query should display:

UserID Full Name Email Department WorkstationID

AAA12 John Doe JD1@xyz.com Finance ABC1234
AAA13 Jane Doe JD2@xyz.com Marketing ABC5678


I'm hoping I explained this enough and thank you in advance for the help!
Go to the top of the page
 
ranman256
post Aug 14 2019, 08:18 AM
Post#2



Posts: 902
Joined: 25-April 14



attach the txt file as an external table. (save it to the same place everytime : c:\temp\File2Import.csv, link it using a SPEC file )
once linked as a table then you just run an append query(s) to bring in the data

qaImportUsers
qaImportEmails
qaImportWS

each query would check for not null in the field, qaImportUsers:
select * from tTbl2Import where [Userid] not null

you can do a check to see which has data:

if Dcount("*","qaImportUsers")>0 then docmd.openquery "qaImportUsers"
if Dcount("*","qaImportEmails")>0 then docmd.openquery "qaImportEmails"
...
This post has been edited by ranman256: Aug 14 2019, 08:19 AM
Go to the top of the page
 
DanielPineault
post Aug 14 2019, 08:19 AM
Post#3


UtterAccess VIP
Posts: 6,847
Joined: 30-June 11



If your CSV contains UserIds where is the rest of the information coming from?

Please explain a little bit more.


As for the general idea, if there is some type of pattern to distinguish between UserIDs, Workstation IDs, and/or Email Addresses, then yes, we should be able to create a function that can import the data accordingly.

--------------------
Daniel Pineault (2010-2019 Microsoft MVP)
Professional Help: http://www.cardaconsultants.com
Free MS Access Code, Tips, Tricks and Samples: http://www.devhut.net

* Design should never say "Look at me". It should always say "Look at this". -- David Craib
* A user interface is like a joke, if you have to explain it, it's not that good! -- Martin LeBlanc


All code samples, demonstration databases, links,... are provided 'AS IS' and are to be used at your own risk! Take the necessary steps to check, validate ...(you are responsible for your choices and actions)
Go to the top of the page
 
DanielPineault
post Aug 14 2019, 08:19 AM
Post#4


UtterAccess VIP
Posts: 6,847
Joined: 30-June 11



@ranman256 - interesting approach!

--------------------
Daniel Pineault (2010-2019 Microsoft MVP)
Professional Help: http://www.cardaconsultants.com
Free MS Access Code, Tips, Tricks and Samples: http://www.devhut.net

* Design should never say "Look at me". It should always say "Look at this". -- David Craib
* A user interface is like a joke, if you have to explain it, it's not that good! -- Martin LeBlanc


All code samples, demonstration databases, links,... are provided 'AS IS' and are to be used at your own risk! Take the necessary steps to check, validate ...(you are responsible for your choices and actions)
Go to the top of the page
 
mir4ge
post Aug 14 2019, 08:33 AM
Post#5



Posts: 5
Joined: 14-March 19



@ranman, I'll give that a shot here in a bit and see if I run into any issues! Thank you!

@Daniel, The data it is looking against is coming from a Passthrough Query. Thanks!
Go to the top of the page
 
mir4ge
post Aug 14 2019, 11:53 AM
Post#6



Posts: 5
Joined: 14-March 19



@ranman thanks for the help! Your solution helped quite a bit!
Go to the top of the page
 


Custom Search


RSSSearch   Top   Lo-Fi    19th September 2019 - 04:21 PM