OK.
Im using Access and VB. I have data on two tables in access that I want to show on vb. 1 text box will show 1 data from 1table and same with the other table. i've opened both tables on vb using the recordset and the if not...EOF Then...MoveNext on the form load.
i'v put the code behind the listbox to show the data form the seperate tables in the textboxes but it still won't work. Could anyone please tell me what in missing. Please give all the solutions you have. THANK YOU 4 ALL ANSWERS 7 1376
OK.
i'v put the code behind the listbox to show the data form the seperate tables in the textboxes but it still won't work. Could anyone please tell me what in missing. Please give all the solutions you have. THANK YOU 4 ALL ANSWERS
I have all the solutions for you ,but can you kindly clarify this i'v put the code behind the listbox to show the data form the seperate tables in the textboxes
if u can post it clearly then it will be easier to understand and solve your problem.
Ignore me - just registering an interest in this thread.
OK. What I meant was...
I'm doing a school project. I'm making a system software for an internet cafe. For this I'm using Visual basic and Microsoft Access. I'm using this code: - Private Sub Form_Load()
-
-
Set dbMyDb = OpenDatabase("C:\Documents and Settings\Shahidul\My Documents\Computing Project\Database.mdb")
-
Set rsDvd = dbMyDb.OpenRecordset("DVD", dbOpenDynaset)
-
-
If Not rsDvd.EOF Then rsDvd.MoveFirst
-
Do While Not rsDvd.EOF
-
lstdvd.AddItem rsDvd!DVD_no
-
lstdvd.List(lstdvd.NewIndex) = rsDvd!Name
-
rsDvd.MoveNext
-
Loop
-
-
Set rsMember = dbMyDb.OpenRecordset("Member", dbOpenDynaset)
-
-
If Not rsMember.EOF Then rsMember.MoveFirst
-
-
Do Until rsMember.EOF
-
rsMember.MoveNext
-
Loop
-
-
-
End Sub
-
-
Private Sub lstdvd_Click()
-
-
Set rsDvd = dbMyDb.OpenRecordset("DVD", dbOpenDynaset)
-
-
txtdvdno.Text = rsDvd!DVD_no
-
txtname.Text = rsDvd!Name
-
txtTakendate.Text = rsDvd!Date_taken
-
txtReturndate.Text = rsDvd!Date_return
-
txtrent.Text = rsDvd!Renting_cost
-
txtbuy.Text = rsDvd!Buying_cost
-
txtmemberid.Text = rsMember!Member_id
-
txtFname.Text = rsMember!First_name
-
txtLname.Text = rsMember!Last_name
-
End Sub
So when I click on the list box selecting one data should be taken from the DVD table and show in the specified box and data from the Member table should do the same in their textboxes. But I get an error NO CURRENT RECORD or some other error after I've tried to fix it. Have you got any solutions for this please?
Can you tell us exactly where in the code the error occurs?
Another question. At lines 17 to 19, why are you reading all of the member records, if you're not going to do anything with them?
Hm... it seems to me that in the lstdvd_Click routine, when you try to access anything from rsMember, you have already (as mentioned in my prior post) moved past the end of this recordset, and so will produce an error.
OK. What I meant was...
I'm doing a school project. I'm making a system software for an internet cafe. For this I'm using Visual basic and Microsoft Access. I'm using this code: - Private Sub Form_Load()
-
-
Set dbMyDb = OpenDatabase("C:\Documents and Settings\Shahidul\My Documents\Computing Project\Database.mdb")
-
Set rsDvd = dbMyDb.OpenRecordset("DVD", dbOpenDynaset)
-
-
If Not rsDvd.EOF Then rsDvd.MoveFirst
-
Do While Not rsDvd.EOF
-
lstdvd.AddItem rsDvd!DVD_no
-
lstdvd.List(lstdvd.NewIndex) = rsDvd!Name
-
rsDvd.MoveNext
-
Loop
-
-
Set rsMember = dbMyDb.OpenRecordset("Member", dbOpenDynaset)
-
-
If Not rsMember.EOF Then rsMember.MoveFirst
-
-
Do Until rsMember.EOF
-
rsMember.MoveNext
-
Loop
-
-
-
End Sub
-
-
Private Sub lstdvd_Click()
-
-
Set rsDvd = dbMyDb.OpenRecordset("DVD", dbOpenDynaset)
-
-
txtdvdno.Text = rsDvd!DVD_no
-
txtname.Text = rsDvd!Name
-
txtTakendate.Text = rsDvd!Date_taken
-
txtReturndate.Text = rsDvd!Date_return
-
txtrent.Text = rsDvd!Renting_cost
-
txtbuy.Text = rsDvd!Buying_cost
-
txtmemberid.Text = rsMember!Member_id
-
txtFname.Text = rsMember!First_name
-
txtLname.Text = rsMember!Last_name
-
End Sub
-
So when I click on the list box selecting one data should be taken from the DVD table and show in the specified box and data from the Member table should do the same in their textboxes. But I get an error NO CURRENT RECORD or some other error after I've tried to fix it. Have you got any solutions for this please?
let see -
Set rsDvd = dbMyDb.OpenRecordset("DVD", dbOpenDynaset)
-
...............
-
Set rsMember = dbMyDb.OpenRecordset("Member", dbOpenDynaset)
-
did u mean that DVD and Member are tables? -
Set rsMember = dbMyDb.OpenRecordset("Member", dbOpenDynaset)
-
If Not rsMember.EOF Then rsMember.MoveFirst
-
Do Until rsMember.EOF
-
rsMember.MoveNext
-
Loop
-
what does this code do? -
Private Sub lstdvd_Click()
-
Set rsDvd = dbMyDb.OpenRecordset("DVD", dbOpenDynaset)
-
txtdvdno.Text = rsDvd!DVD_no
-
txtname.Text = rsDvd!Name
-
txtTakendate.Text = rsDvd!Date_taken
-
txtReturndate.Text = rsDvd!Date_return
-
txtrent.Text = rsDvd!Renting_cost
-
txtbuy.Text = rsDvd!Buying_cost
-
txtmemberid.Text = rsMember!Member_id
-
txtFname.Text = rsMember!First_name
-
txtLname.Text = rsMember!Last_name
-
End Sub
-
here, u havent open rsMember yet. So, u cannot access to its rows. If u declare rsMember as a local varriable. It may havent been dispose at this possition but u moved its cursor to EOF at Do...Loop.
i dont know the relation between DVD and Member table . If it has , u should make a Query to select datas on these two tables first. And then u can open this Query (as the same as open the table) to get datas. Otherwise, u donot have reason to get datas of two table at the same possition.
if it's not a private, show me ur database structure and let me know what do u need for this program.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Carlos Ribeiro |
last post by:
Hello all,
I'm posting this to the list with the intention to form a group of
people interested in this type of solution. I'm not going to spam the
list with it, unless for occasional and...
|
by: Random Person |
last post by:
Does anyone know how to use VBA to relink tables between two MS Access
databases? We have two databases, one with VBA code and the other with
data tables. The tables are referenced by linked...
|
by: Grasshopper |
last post by:
Hi,
I am automating Access reports to PDF using PDF Writer 6.0. I've
created a DTS package to run the reports and schedule a job to run this
DTS package. If I PC Anywhere into the server on...
|
by: Daveyk0 |
last post by:
Hello there,
I have a front end database that I have recently made very many changes
to to allow off-line use. I keep copies of the databases on my hard
drive and link to them rather than the...
|
by: sara |
last post by:
I am learning Access and programming. I wanted to have the user select
the departments for an ad from the list of all departments. Found code
(that I could understand) on this site, and it works....
|
by: chellappa |
last post by:
hi
this simple sorting , but it not running...please correect error for
sorting using pointer or linked list sorting , i did value sorting in
linkedlist
please correct error
#include<stdio.h>...
|
by: g18c |
last post by:
Hi, i have a class which has a property which is a list of items. I
want to be able to set this item list from a set of items (in this case
list2 as shown in the code below) from a drop down combo...
|
by: Julia |
last post by:
I am trying to sort a linked list using insertion sort. I have seen a
lot of ways to get around this problem but no time-efficient and
space-efficient solution. This is what I have so far:
...
|
by: AZRebelCowgirl73 |
last post by:
This is what I have so far:
My program!
import java.util.*;
import java.lang.*;
import java.io.*;
import ch06.lists.*;
public class UIandDB {
|
by: Debajit Adhikary |
last post by:
I have two lists:
a =
b =
What I'd like to do is append all of the elements of b at the end of
a, so that a looks like:
a =
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
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,...
|
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...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
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...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
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...
| |