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

suryu

Member
Local time
Today, 08:24
Joined
Apr 3, 2020
Messages
55
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
Local time
Yesterday, 19:54
Joined
Oct 29, 2018
Messages
10,258
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, 08:24
Joined
Apr 3, 2020
Messages
55
Hey no, using macros i need to do, check once again my post
 

suryu

Member
Local time
Today, 08:24
Joined
Apr 3, 2020
Messages
55
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
Local time
Yesterday, 19:54
Joined
Oct 29, 2018
Messages
10,258
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, 08:24
Joined
Apr 3, 2020
Messages
55
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
Local time
Yesterday, 19:54
Joined
Oct 29, 2018
Messages
10,258
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, 08:24
Joined
Apr 3, 2020
Messages
55
no, i have not tried

how to copy from query to directly paste to active sheet
 

suryu

Member
Local time
Today, 08:24
Joined
Apr 3, 2020
Messages
55
Thanks , i was doing from other logic but now its done :)
 

suryu

Member
Local time
Today, 08:24
Joined
Apr 3, 2020
Messages
55
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
Local time
Yesterday, 19:54
Joined
Oct 29, 2018
Messages
10,258
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, 08:24
Joined
Apr 3, 2020
Messages
55
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 (Users: 0, Guests: 1)

Top Bottom