Hi
When you create a new data connection (using the Wizards) I presume a new Connection object is added to your project containing the connection string etc. amoungst it's properties.
I want to pass that connection object to another object - how can I reference the projects Connection Object...
I need to return the Count and Sum of a query in VBA.
i.e.
Dim Db as DAO.Database
Dim rst as DAO.Recordset
Dim SQL as string
Dim Total as Integer
SQL = "SELECT SUM (etc. Etc)" ....with paramters taken from a form text boxes.
Set Db = CurrentDb
Set rst as Db.OpenRecordset(SQL, DbOpenDynaset)...
Before I'm tempted to spend more cash on an Add In.....
When you view VB code in the IDE, the functions/procedures are nicely divided by lines across the screen making it easy to see when one begins and the other ends.
Is there a hidden option somewhere to print these lines when printing out...
Thanks for explaining this further -
Only thing I don't quite grasp here is how does the GC know whether a NOTHING variable (effectively memory set aside but not used - i.e. just DIM'ed) isn't just waiting for a value. At what point are they ready to be "Garbaged"?
What is the general rule on setting objects to Nothing & Dispose in VB.Net.
I read some where the VB.NET "cleans up" and releases onjects. When reading about VB.Net some examples set objects like OleCommand objects to Nothing and Dispose of them whilst others don't....
What is the general...
Many thanks for your response.
After a little trial and error I managed to come up with a solution.
Because I am loading the ComboBox from a Dataset, the Combox contains a collection of data row (objects) not just simple numbers.
To get to the Value Member and Display Member I created a...
I have Combobox which is filled via a dataset and datatable as follows.
'Get table from the dataset
DT = DS.Tables(0)
'Fill the ComboBox
With cboMediaCode
.DataSource = DT
.ValueMember = "MID"
.DisplayMember = "MediaCode"
End With
How do I retrieve the ValueMember ("MID")...
I am adding a new record to an Access table using a OleCommand and SQL string containing "INSERT INTO tblOrders etc...." The back end table contains a AutoNumber field to generate a unique Order ID ("OID")as soon as the new record details are inserted by the code.
My problem is that I need to...
I want to load a Combo Box with a simple list of Countries from a table using the add method.
When I load the Countries I also need to add the Countries unique table ID so I can retrieve the users selection by the ID not the Country Name.
i.e if "Germany" had an unique table ID of "17", I need...
I am connecting to an access database by dragging data objects onto my form (Dataset etc.) I want to be able to change the (OleDbCommand)Command Text property at run time so it includes the value from a text box in the query. But I dont know how to get to the Command Text property.
Can any one...
Thanks for the response migr8now.
No doubt there is a logical reason for it hiding away in someone's head at Microsoft!
For those who also want to discover the "Secret of the Key" - you can retreive it with:
Private Sub lstContacts_ItemActivate(ByVal sender As Object, ByVal e As...
When you add each item you can give it a key (or name)as string, the item text as string and the image key.
The item key (or name) is a unique indentifier for the item.
In VBA you can use the Item-Click event which passes the Item as an object where you can get its item key. I can't find the...
I have created a ListView in VB.NET and added an item using:
lstView.Items.Add("Item/1", "An Item", 0)
Thus the item key is "Item/1".
How do I retrieve the item key. What event do I use etc.
Any help appreciated.
Thanks
I all new to VB.NET (2008) but am slowing moving across from VBA.
What is the best (EASIEST) way to connect, read and write data to an access database? ADO.NET? I also need to be able to include queries with parameter values taken from fields on forms. I am not sure where to start.
Sorry this...
I have built lots of Access/Excel/Word VBA applications / functions and am now looking at the future - but I am well confused.
Can anyone please help explain where VBA is heading in terms of MS Office. Does VSTO now completely replace VBA (albeit using the .net IDE). Do I buy VSTO as a separate...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.