Hello Everybody,
Please tell me is there any way to populate an unbound form of MS Access 2002 with Recordset of an MS Access 2002 external database??
if yes then how???
I dont wana link tables/queries what i want is to hold all data in recordset and then display it into the form like continuous forms.
thank u.
2 18613 FishVal 2,653
Recognized Expert Specialist
Hi, where.
You may try to use Form.Recordset property.
The following code bind an unbound form to table [t1] located in the same db. -
Private Sub Form_Open(Cancel As Integer)
-
Set Me.Recordset = CurrentDb.OpenRecordset("SELECT * FROM t1;")
-
End Sub
-
P.S. Sure, forms controls are expected to have right values in ControlSourcce property.
ADezii 8,834
Recognized Expert Expert
Hello Everybody,
Please tell me is there any way to populate an unbound form of MS Access 2002 with Recordset of an MS Access 2002 external database??
if yes then how???
I dont wana link tables/queries what i want is to hold all data in recordset and then display it into the form like continuous forms.
thank u.
Let's assume you wish to populate an Unbound Access Form consisting of three Unbound Text Boxes named txtFirstName, txtLastName, and txtBirthDate. Furthermore, the mechanism with which you wish to populate this Form is via a Recordset created on an External Database. In this scenario, the External Database is Northwind.mdb residing in the C:\Test\ Directory. We will use the Employees Table as the source of the Recordset and populate our Unbound Access Form and Text Boxes with 3 Fields from this Recordset. Follow these 3 simple steps: - Place the following Declarations in the Form's Code Module (Declarations Section):
- Dim wrkJet As Workspace
-
Dim dbsNorthwind As DAO.Database, rstNorthWind As DAO.Recordset
- Copy and Paste the following code to the Open() Event of the Form:
- Private Sub Form_Open(Cancel As Integer)
-
'Create Microsoft Jet Workspace object.
-
Set wrkJet = CreateWorkspace("", "admin", "", dbUseJet)
-
-
'Open Database object from saved Microsoft Jet database for exclusive use
-
Set dbsNorthwind = wrkJet.OpenDatabase("C:\Test\Northwind.mdb", True)
-
-
Set rstNorthWind = dbsNorthwind.OpenRecordset("Employees", dbOpenDynaset)
-
-
Set Me.Recordset = rstNorthWind
-
-
Me![txtFirstName].ControlSource = "FirstName"
-
Me![txtLastName].ControlSource = "LastName"
-
Me![txtBirthDate].ControlSource = "BirthDate"
-
End Sub
- Place the following code in the Close() Event of the Form:
- Private Sub Form_Close()
-
rstNorthWind.Close
-
Set rstNorthWind = Nothing
-
End Sub
- This code has been tested and is fully operational, let me know how you make out.
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Tim Marshall |
last post by:
This is an embarrassing question to which I should know the answer, but
I am not 100% sure of myself. My applications, whether they are Jet or
Oracle usually deal with reporting on existing apps that others have
done and except for the odd single user app, I don't do many transaction
type applications....
Anyways,
I have an unbound form...
|
by: ano1optimist |
last post by:
I have a form with a search button. I'm using command parameters to
pass search criteria to a stored procedure. Here is my code:
Stored procedure:
CREATE PROCEDURE .
@strCriteria varchar(200)
AS
execute (@strCriteria)
GO
|
by: huela |
last post by:
Somehow i have to display the recordset in unbound form
When i use the following display the data in recordset to unbound
form.
I have a question:
i can only display the last record data, all previous data are
overwrittend. why i can't create the continues form or datasheet
display the data line by line.
Thanks a lot for the help
|
by: Pierre |
last post by:
Hi all,
To ease load on a network i close automatically form open
with a timer reset by user actions.
If the time is expired i go through the collections
of form and table and close all those that are open.
I choose this way to avoid putting code in each form, plus i can close all
open table if any
|
by: Stig |
last post by:
Hi,
Any help on this one will be greatly appreciated as I have spent too
long banging my head against the screen trying to get it sorted.
Basically I would like to have a select all records option in a combo
box that is used in an unbound form for my report parameter. I have
tried to explain it in further detail below: -
In my DB I have...
| |
by: ndindi22 |
last post by:
HI guys,
How do I Add/ Edit/ Delete using Unbound MS Access .adp Project/ VBA Form
I need to populate the form manually by executing SQL statements in the VBA code. Add buttons to the form to position to the first, last, next, and previous row. Add buttons that facilitate add, edit, and delete through the use of SQL.
My MS Access form,...
|
by: Volker Neurath |
last post by:
Hi all,
I have a Problem with combobox-property "NotInList" and an unbound Form.
The situation:
On my main form i have three comboboxes for data-exchange (here: Names of
distributor, reseller and final customers, the whole database is made
for storing information about quotatations - no, not for quoting itself)
ut the boxes actually...
|
by: patjones |
last post by:
Hi:
There are many posts both here and on other forums about this topic, but nothing quite matching what I have...
I have an unbound form called frmChecks which displays information by means of an ADO recordset. Whenever I search for something, I have a globally defined subroutine, UpdateForm, that uses a SQL string to pull information into...
|
by: troy_lee |
last post by:
I have an unbound form. I have an Add New procedure that saves a new
record to the database. What is the best way to update an existing
record? In other words, clicking my "Submit record" button creates
another new instance of the record when all I want is to update a
field or two and save over the existing record.
Thanks in advance.
Troy
|
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. ...
|
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...
| |
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...
|
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...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert...
|
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...
|
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
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...
| |