I don't understand. Once you modify the SQL statement in the querydef, then just open the query like normal with Docmd.Openquery.
Greg RosoffOP
@Reply 2 years ago
The string of fields is too long
Greg RosoffOP
@Reply 2 years ago
This is the string of fields I want to pull from the table, but I don't know how to specifically list them out as the string is too long
SELECT TBL_DMHRSI_STAFF_PRD.DATE_PULLED, TBL_DMHRSI_STAFF_PRD.TI_CD, TBL_DMHRSI_STAFF_PRD.EDIPI, TBL_DMHRSI_STAFF_PRD.DUPLICATE_EDIPI, TBL_DMHRSI_STAFF_PRD.DMHRSI_EMP_NUM, TBL_DMHRSI_STAFF_PRD.FULL_NAME, TBL_DMHRSI_STAFF_PRD.PERSON_TYPE, TBL_DMHRSI_STAFF_PRD.TITLE_RANK, TBL_DMHRSI_STAFF_PRD.UPDATED_EMAIL, TBL_DMHRSI_STAFF_PRD.VALIDATED_EMAIL, TBL_DMHRSI_STAFF_PRD.NOT_IN_GLOBAL, TBL_DMHRSI_STAFF_PRD.IN_GLOBAL_NO_EMAIL, TBL_DMHRSI_STAFF_PRD.PERSON_UIC_OR_PAS, TBL_DMHRSI_STAFF_PRD.ORGANIZATION_NAME, TBL_DMHRSI_STAFF_PRD.PERSON_EFFECTIVE_START_DATE, TBL_DMHRSI_STAFF_PRD.PERSON_EMAIL_ADDRESS, TBL_DMHRSI_STAFF_PRD.POSITION_EFFECTIVE_START_DATE, TBL_DMHRSI_STAFF_PRD.POSITION_TITLE, TBL_DMHRSI_STAFF_PRD.SUPERVISOR_FULL_NAME, TBL_DMHRSI_STAFF_PRD.SUPERVISOR_EDIPI, TBL_DMHRSI_STAFF_PRD.SUPERVISOR_EMAIL, TBL_DMHRSI_STAFF_PRD.PERSON_SERVICE, TBL_DMHRSI_STAFF_PRD.PERSON_GRADE
FROM TBL_DMHRSI_STAFF_PRD
Sami Shamma
@Reply 2 years ago
WOW
Greg RosoffOP
@Reply 2 years ago
BTW, Thank you for even looking at this on a Saturday!
I don't understand, again. Your object names above are completely meaningless, so why don't you explain to me in English what everything represents, or rewrite it so someone who doesn't understand your names can comprehend it. What's a cmb_SUT_TI_CD? No clue. See: All About Context
Sure. You're just creating a string. Make the string first, then you can MsgBox it to make sure it's correct, and then assign it to your querydef. But I still think you'll benefit from smaller field names.
Greg RosoffOP
@Reply 2 years ago
Thank you! Get back to the beers and brats and I am very grateful for the weekend input.
I took last week off to go to Jamaica... so I'm catching up this week. :)
Greg RosoffOP
@Reply 2 years ago
That was time well spent. BTW, are you doing courses on Python?
Christopher Hankwembo
@Reply 2 years ago
I have assumed that you already declared the variable for the record set , then simply use the code like below + a criteria:
Set rst = db.OpenRecordset("select vsdcRcptPbctDate,rcptNo,intrlData,rcptSign,sdcId,SqrCode FROM [tblCustomerInvoice] WHERE [InvoiceID] = " & Me.txtJsonReceived)
Sorry, only students may add comments.
Click here for more
information on how you can set up an account.
If you are a Visitor, go ahead and post your reply as a
new comment, and we'll move it here for you
once it's approved. Be sure to use the same name and email address.
This thread is now CLOSED. If you wish to comment, start a NEW discussion in
Access SQL Server Lessons.