Hi there, I am trying to populate a continuous form using ADO, following is
the function which needs fixing, can someone kindly help me with this.
Thanks much
Private Sub Form_Load()
On Error GoTo err_Form_Load
Dim objRstADO As ADODB.Recordset
Dim sqlstr As String
Dim tZone As String
If PostgreSQLADOCo nnection() Then
tZone = "set timezone to 'GMT'; set datestyle to 'ISO'; " & _
"select version(), case when pg_encoding_to_ char(1) =
'SQL_ASCII' " & _
"then 'UNKNOWN' else getdatabaseenco ding() end"
cPostgreSQL.Exe cute tZone
sqlstr = "Select a.id, a.name, count(*) as count " & _
"FROM tblcustomer a, tblorder b " & _
"WHERE a.order_id=b.id " & _
"GROUP BY 1,2 " & _
"ORDER BY 3 DESC"
Set objRstADO = cPostgreSQL.Exe cute(sqlstr, , adLockReadOnly)
Set Me.Recordset = objRstADO
Do While Not objRstADO.EOF
objRstADO.MoveN ext
Me.txtID = objRstADO("id")
Me.txtName = objRstADO("name ")
Me.txtCount = objRstADO("coun t")
Loop
objRstADO.Close
Set objRstADO = Nothing
Else
MsgBox "Connection error: Could not execute"
End If
Exit Sub
err_Form_Load:
MsgBox Err.Number & " - " & Err.Description , vbOKOnly
End Sub 1 2997
For one thing, you shouldn't need the loop at the end populating your
controls.
Setting the Recordset property of your form should be sufficient.
Also, you haven't specified what behavior you're getting here, so I don't
know exactly what you want but aren't getting.
But I would be very surprised if this SQL returned a recordset which was
updatable.
HTH
- Turtle
"tmuhammad" <tm*******@roge rs.com> wrote in message
news:MY******** ************@ne ws04.bloor.is.n et.cable.rogers .com... Hi there, I am trying to populate a continuous form using ADO, following
is the function which needs fixing, can someone kindly help me with this. Thanks much
Private Sub Form_Load()
On Error GoTo err_Form_Load
Dim objRstADO As ADODB.Recordset Dim sqlstr As String Dim tZone As String
If PostgreSQLADOCo nnection() Then
tZone = "set timezone to 'GMT'; set datestyle to 'ISO'; " & _ "select version(), case when pg_encoding_to_ char(1) = 'SQL_ASCII' " & _ "then 'UNKNOWN' else getdatabaseenco ding() end" cPostgreSQL.Exe cute tZone
sqlstr = "Select a.id, a.name, count(*) as count " & _ "FROM tblcustomer a, tblorder b " & _ "WHERE a.order_id=b.id " & _ "GROUP BY 1,2 " & _ "ORDER BY 3 DESC"
Set objRstADO = cPostgreSQL.Exe cute(sqlstr, , adLockReadOnly)
Set Me.Recordset = objRstADO
Do While Not objRstADO.EOF
objRstADO.MoveN ext Me.txtID = objRstADO("id") Me.txtName = objRstADO("name ") Me.txtCount = objRstADO("coun t") Loop objRstADO.Close Set objRstADO = Nothing
Else MsgBox "Connection error: Could not execute" End If Exit Sub
err_Form_Load: MsgBox Err.Number & " - " & Err.Description , vbOKOnly End Sub This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Prakash Wadhwani |
last post by:
Is there any EASY way to highlight a full row in a continuous form so
that as i navigate up & down the table/continuous form using the arrow
keys, the entire line (all fields) get highlighted ?
This will give the effect of a bar moving up & down. BTW, all fields
are locked so this form is View-Only & not editable.
Thx & Best Rgds,
Prakash.
|
by: Damian |
last post by:
Hi.
Is there a way to programatically populate a continuous form?
I have an array of descriptions that I want to display in the
continuous form and I have a textbox on the form called
'txtDescription'
I can populate the text box using this code:
Me.txtDescription.Value = myArray(1)
Trouble is, I can't figure out how to get more than 1 row to display
|
by: Mark |
last post by:
Hi there, I have a subform, set as a continuous form.
When a user selects a particular record in that subform, how can I make that
particular record stand out (color or font change, size, etc) from
the other records in the list?
Thank you in advance,
Mark
|
by: David |
last post by:
Hi,
I need a button shown for each record (cont. form) with specific
captions on each.
I have a notes form for each record. When a user presses the button
they can read the notes. I want to display a caption on the button to
state either "Order Notes" or "READ NOTES".
I placed a label over the button, and depending if the notes field is
|
by: Richard Hollenbeck |
last post by:
I have the following query in my form's code:
Private Function Get_Data(fieldNum As Integer)
Dim strSQL As String
Dim db As DAO.Database
Dim rs As DAO.Recordset
strSQL = "SELECT & "", "" & AS Student,
activities.activityDescription, studentScores.score FROM groups INNER JOIN
(students INNER JOIN (activities INNER JOIN studentScores ON
| |
by: Kathy |
last post by:
What is the standard technique for handling the fields in the following
scenario on a continuous form?
Multiple Divisions. Each Division has multiple Buildings. Each Building has
a Supervisor.
Tables: (abbreviated)
TblDivision
DivisionID
|
by: monsey11 |
last post by:
Hi all,
I'm racking my brain to come with an idea for a form.
here are the requirements:
its for a custom quilt manufacturer and on each quilt order there may
be added many customizable options. there is too many option to list in
|
by: Desmond Shek |
last post by:
Hi,
I am new to this DB caper and am really struggling.
I have a form called customers with a subform called property search. The subform (a continuous form) allows users to search the table 'property' using multiple criteria (postcode, house num etc) and returns a set of matching results.
I want to be able automatically populate the a field called LPI (a unquie property ref which is the PK of table property and FK of table customers)...
|
by: eighthman11 |
last post by:
using Access 2003 and sql server version 8.0
Hey everyone. Created a text box where the user types in an Inventory
number and it takes them to that inventory number on the contimuous
form. The form is based on a link table to sql server. Here is the
code:
Dim rst As DAO.Recordset
Dim InventoryItem As String
InventoryItem = "'" & "TextBoxValue" & "'"
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |