This is not my code I wish I could remember who to give credit to but I found it several months back
Private Function createAttached(strTable As String, strPath As String, strBaseTable As String) As Boolean
'************************************************************************************
'*...
Hello All
I have this code
Private Sub cmdCalcPowerDbGainLoss_Click()
Dim PowerGainRatio As Double
PowerGainRatio = Me.tboxOutputPower / Me.tboxInputPower
Me.tboxDbGainLoss = Log(PowerGainRatio) * 0.43429
Me.tboxDbGainLoss = Me.tboxDbGainLoss * 10...
It appears my thread is dying so I am starting to believe what I want to do isn't possible
anyway just a little more experimenting produced this
Database Type Microsoft Access (mdb)
Absolute Page -1
Absolute Position -1
BOF False
CacheSize 1
CursorLocation...
in an attempt to follow through on lameid suggestion
I used the following code
Dim i As Integer
With rst
For i = 0 To (.Properties.Count - 1)
Debug.Print i & " " & .Properties(i).Name & ", " & Properties(i)
Next i
End With
which produced the following...
Thanks for the info MajP
after looking through the links you provided I still don't have a solution
when I created a recordset with a SELECT statement from a table in the database I was able to bind that recordset to the form but I still can't bind an OpenSchema(adSchemaTables) recordset. I...
I have to think that there must be a difference between a ADO recordset retrieved from a SQL Server database and one retrieved from an Access database but I have no explanation as to why this would be. The only difference in the code is the connection string.
In the interest of being thorough...
thank you for the reply
Ok I tried
Forms!frmData.Recordset = rst
and I got
Runtime error 91
object variable or with block variable not set
I feel I should say again that
Set Forms!frmData.Recordset = rst
works if I connect to a MS SQL Server
I'm trying to set an Access Forms recordset to an ADO recordset containing a list of tables in an Access .mdb database
with the following code
Set rst = objConnection.OpenSchema(adSchemaTables)
rst.MoveLast
rst.MoveFirst
Debug.Print rst!TABLE_NAME
Set...
I tried several different cursorlocations while creating the recordset with no success
and I have spent more time on this than I wanted to so I think I will just create a new
connection to the server and create recordsets with SQL sorted the way I want it displayed
I'm sure you are facing me in...
here's my newly attempted code
Private Sub cmdSort_Click()
Dim RS2 As adodb.Recordset
Set RS2 = Me.Recordset
RS2.CursorLocation = adUseClient
RS2.Sort = ""
Set Me.Recordset = RS2
End Sub
and that gives me an error at
Set Me.Recordset = RS2
Run-time error
Method...
I tried several different fields with same results
I also tried
RS2.Sort = ""
which I read should reset the order to it's original state
but I still get the same error
Thank you borh for your time spent
MajP
your code
Private Sub EmployeeID_Click()
Dim RS2 As adodb.Recordset
Set RS2 = Me.Recordset
RS2.Sort = "FirstName"
Set Me.Recordset = RS2
End Sub
is actually what I'm interested in.
you say it works for you unfortunately it doesn't for me
I am using...
Just to be thorough I have no problem with this code
here is the code that populates the data in the form
Dim strConnectionString As String
Dim objConnection As adodb.Connection
Dim rst As New adodb.Recordset
Dim strSQL As String
'create the connection to the server...
PHV
ok this code
Dim rst As DAO.Recordset
Set rst = Me.Recordset
Debug.Print rst.RecordCount
give error Type mismatch at
Set rst = Me.Recordset
MajP
I think what your saying is the reverse of what I'm trying to do, assign a forms recordset to a recordset object
if not then please just a...
PHV
>By default, a Form's recordset is ADO, not ADO.
I can only assume you mean a forms recordset is DAO, not ADO
>So, again, how you assign the forms recordset to an ado recordset ?
I don't know how to assign a forms recordset to an ADO recordset, I don't even know if it can be done that is...
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.