deafmetal1
Senior Chief
- Local time
- Today, 23:17
- Joined
- May 2, 2008
- Messages
- 30
I'm working on a VBA query that gets it's initial query criteria from a string.
i.e., strHULL
Let's say strHULL ends up equaling DDG89. I have a table containing a column with ship's hull # (DDG89), Name (USS MUSTIN), and Homeport (Yokosuka Japan).
I want the query, when invoked, to fetch both the associated name and homeport from that table(we'll call it SHIPS), preferably each as their own string(let's call them strNAME and strHOME), which then each populate a filed in a different table during a separate Public Sub.
So when invoked, the query would pull from the SHIPS table, finding DDG89, and grabbing the next two cells from the same record, USS MUSTIN and Yokosuka Japan. Make sense?
This entire process is a Public Function.
I am not trying to be lazy by not including framework code, because I am still a novice at VBA, reverse-engineering code while learning as I go. All of my project uses DAO recordset functions. And I am just unsure of the best method to execute this query. I've tried DAO stuff and DLOOKUP stuff, no joy.
Thank you for your help as always!!!
i.e., strHULL
Let's say strHULL ends up equaling DDG89. I have a table containing a column with ship's hull # (DDG89), Name (USS MUSTIN), and Homeport (Yokosuka Japan).
I want the query, when invoked, to fetch both the associated name and homeport from that table(we'll call it SHIPS), preferably each as their own string(let's call them strNAME and strHOME), which then each populate a filed in a different table during a separate Public Sub.
So when invoked, the query would pull from the SHIPS table, finding DDG89, and grabbing the next two cells from the same record, USS MUSTIN and Yokosuka Japan. Make sense?
This entire process is a Public Function.
I am not trying to be lazy by not including framework code, because I am still a novice at VBA, reverse-engineering code while learning as I go. All of my project uses DAO recordset functions. And I am just unsure of the best method to execute this query. I've tried DAO stuff and DLOOKUP stuff, no joy.
Thank you for your help as always!!!
Last edited: