TheSwamp
Code Red => VB(A) => Topic started by: Amsterdammed on October 29, 2007, 10:52:31 AM
-
Hello everybody,
Can i read data from an access dbase into a dialog box in VBA?
Thanks in advance
Bernd
-
Affirmative.
If what you're really asking is "How can I read a database and populate a form's control, be it a list box or a data grid etc." then the answer will be a little more more verbose. On said topic there are about 10 billion resources available on the net. Perhaps we could steer you to some appropriate ones if you provide a little more detail. :)
-
Michael,
right, i was pretty short and not very specific :oops:, but that
"How can I read a database and populate a form's control, be it a list box or a data grid etc."
is what i was looking for. I don;'t do much in VBA but this one needs to be done in VBA since i will have to do part off it out of a xls.
Thanks ,
Bernd
-
Try this simple example
Just change full name of databse file
and name of the table
~'J'~
-
Fatty,
that is cool.
Eh, is there any way to write to the mdb file as well?
Thanks in advance
Bernd
-
Fatty, can i simply get that code in Excel running, too?
TiA
Bernd
-
Hi Bernd
Hey, man, two tasks in the same time
is too much for me :lol:
My dim brain is not so quick as you want
I need the time to chew it :)
Still working on examples for you
see ya
~'J'~
-
Fatty, can i simply get that code in Excel running, too?
TiA
Bernd
What is your goal?
Do you want to import data to Excel from Access?
~'J'~
-
Here is an example how to run the code
from Excel
Change in code full name of database file,
table name and field names
Then just push a button
~'J'~
-
Sorry Fatty,
i was out for a while.
I got the first file running in excel with a few changes, funny enough i get an error MSG"can't find isam file"
Thanks Bernd
-
:oops:Sorry again.,
got it going, my mistake. That is cool, now there is only one question remaining, how can i write back from Excel->Access?
Thanks in Advance
Bernd
-
Bernd,
Now is too late for this work
I'll try to do it tomorrow
~'J'~
-
:oops:Sorry again.,
got it going, my mistake. That is cool, now there is only one question remaining, how can i write back from Excel->Access?
Thanks in Advance
Bernd
Here is edited version
Hth
~'J'~
-
Fatty,
I'm on a 9 hour time difference with you right now, so I thought you will read my post in there morning anyway, forgot the Russian work ethic is better than the one in the west :-).
What does
"Select diapazone to export"
mean?
I obviously get always wrong and get an error :-(
Thanks in advance,
Bernd
-
Hi Bernd, no worries :wink:
You wrote:
>>I obviously get always wrong and get an error
After the "Refedit window" will appears you
need to select sheet range manualy and then
hit OK button
You will see before in the textbox
an address of selected range
And don't forget about to change file name etc.
Would this helps?
Let me know if you need some other stuff there
~'J'~
-
Fatty,
That works just fine. :-D
I have one little problem left,
the dbase is part of a vertical my company works with. But it is in Access 97 format. Your code requires the latest version (2002) that i have installed an my laptop. So i can manual convert from 97 -> 2002, do the changes with your code, and than convert it back to 97, but i will have to find a way to do this with vba so that the user doesn't have to do it (they will screw up).
-
Unfortunately, I don't know how to do it by code :(
Maybe somebody from big lads knows it
~'J'~
-
Fatty,
you are one of the big lads. :-)
Thanks for all so far,
Spasiba
Bernd
-
Sorry for the late
I have been crazy busy with my
own work
You are welcome, Bernd
Glad if that helps
Happy coding :)
~'J'~