Hey, need help on some basic stuff related to macro (1 Viewer)

suryu

Member
Local time
Today, 16:09
Joined
Apr 3, 2020
Messages
86
I have opened workbook using macros in access and want to do below steps
1) I have workbook open with some specific columns, i need validation on first column and it should take data from another sheet(distinct value)
2)how to take data in another sheet from query
 
Last edited:

theDBguy

I’m here to help
Staff member
Local time
Today, 03:39
Joined
Oct 29, 2018
Messages
21,358
Hi. This sounds like an Excel problem. If so, I'll ask the mods to move it out of the Access Forum.
 

suryu

Member
Local time
Today, 16:09
Joined
Apr 3, 2020
Messages
86
Hey no, using macros i need to do, check once again my post
 

theDBguy

I’m here to help
Staff member
Local time
Today, 03:39
Joined
Oct 29, 2018
Messages
21,358
Hey no, using macros i need to do, check once again my post
Okay, I'm just saying. Macros between Access and Excel are not the same.
 

suryu

Member
Local time
Today, 16:09
Joined
Apr 3, 2020
Messages
86
i am working on access, and open workbook using below query

set oXL= Createobject("excel.application")
oXL.visible = tRue
set wkbk=oXl.Workbooks.add
set sht = wkbk.sheets(1)

after that i set field value and now i want to take data from query to another sheet

could you tell me how to take data from query to another sheet?
 

theDBguy

I’m here to help
Staff member
Local time
Today, 03:39
Joined
Oct 29, 2018
Messages
21,358
i am working on access, and open workbook using below query

set oXL= Createobject("excel.application")
oXL.visible = tRue
set wkbk=oXl.Workbooks.add
set sht = wkbk.sheets(1)

after that i set field value and now i want to take data from query to another sheet

could you tell me how to take data from query to another sheet?
Hi. Have you tried something like?

Set sht2 = wkbk.sheets(2)
 

suryu

Member
Local time
Today, 16:09
Joined
Apr 3, 2020
Messages
86
yes, i have created another sheet too.

let me brief u again

i have query where one columns data is there.

I want to take distinct data from query 1 to sheet2.

something i am doing code like set qd= currentDb.queryDefs("query1")

after that how to do ?
 

theDBguy

I’m here to help
Staff member
Local time
Today, 03:39
Joined
Oct 29, 2018
Messages
21,358
yes, i have created another sheet too.

let me brief u again

i have query where one columns data is there.

I want to take distinct data from query 1 to sheet2.

something i am doing code like set qd= currentDb.queryDefs("query1")

after that how to do ?
Hi. Have you tried the CopyFromRecordset method?

 

suryu

Member
Local time
Today, 16:09
Joined
Apr 3, 2020
Messages
86
no, i have not tried

how to copy from query to directly paste to active sheet
 

suryu

Member
Local time
Today, 16:09
Joined
Apr 3, 2020
Messages
86
Thanks , i was doing from other logic but now its done :)
 

suryu

Member
Local time
Today, 16:09
Joined
Apr 3, 2020
Messages
86
Hi,

I am facing issues with data validation property.
I have one column data in second sheet and want to take those data from second sheet to first sheet in drop down list using vba code in access.

Could you please help me with that.

thank u in advance
 

theDBguy

I’m here to help
Staff member
Local time
Today, 03:39
Joined
Oct 29, 2018
Messages
21,358
Hi,

I am facing issues with data validation property.
I have one column data in second sheet and want to take those data from second sheet to first sheet in drop down list using vba code in access.

Could you please help me with that.

thank u in advance
Hi. I really don't do much Excel, but take a look at the VBA example at the end of this article. Hope it helps...

 

suryu

Member
Local time
Today, 16:09
Joined
Apr 3, 2020
Messages
86
Hi. I really don't do much Excel, but take a look at the VBA example at the end of this article. Hope it helps...

thanks :)
 

Users who are viewing this thread

Top Bottom