I know this is a free site and the moderators or anybody don't have to answer if they don't want to.. but if there is someone who knows how to answer this question please help with this one.
i have changed my project so many times to try to get the results i want but can't seem to get this one thing to work the datagrid and datalist to work right. i have looked on the web to see if i could do it another way. and read so many books but there isn't another way i have found i have searched this site but nothing but the posts i have left and certainly i won't find the answers there. Because it only has the same question posted. so i guess i will go through my question again.
I have made a program so when i pay a bill i can click on the name of the bill in the datalist. and only them bills for that name will show in the datagrid.
the way i have this set up is, i have TWO ADODC controls on the form. and one datagrid and one datalist.
the first ADODC control is for the DATALIST and the second ADODC control is for the DATAGRID.
the datagrid ADODC2 is connected to a database i have made with the "Visual Data Manager" called "BillDetail s" the connectionstrin g is connected to "BillDetail s" and the recordsource is to the table "DetailsT" which in the database i have these fields
BillID
AmountDue
AmountPaid
DueDate
DatePaid
ReferenceNumber
BillBalance
The "BillID" I have made a text field because i want to add my own ID's. I don't know if you can do this but i have.
the datalist ADODC1 is connected to a database i have made with the "Visual Data Manager" called "BillInformatio n" the connectionstrin g is connected to "BillInformatio n" and the recordsource is "SELECT * FROM DetailsT" the "ROWSOURCE" is to the ADODC1. the "LISTFIELD" is set to the "BILLNAME" the "DATASOURCE " is to ADODC1 the "DATAFIELD" is to "BILLNAME" the "BOUNDCOLUM N" is to the "BILLID" which in the database i have these fields
BillID
BillName
Address
City
State
ZipCode
PhoneNumber
The code for the DATALIST click event is this: - Private Sub Datalist1_Click()
-
Dim strQuery As String
-
strQuery = "Select * FROM DetailsT WHERE BillID = " & _
-
DataList1.BoundText & "'"
-
With Adodc2
-
.RecordSource = strQuery
-
.Refresh '<-----------'This is where i am getting the error
-
'it's not refreshing the datagrid
-
End With
-
With DataGrid1
-
.ClearFields
-
.ReBind
-
End With
-
End Sub
So there it is i hope i can get a response for this
lee123
Apr 29 '09
17 2555 QVeen72 1,445
Recognized Expert Top Contributor
Hi,
Yes, If the data is from another Table, then you will need another ADODC
Regards
Veena
all of that being said how do i modify this code to do this with 8 textboxes instead of a datagrid: - Dim strQuery As String
-
strQuery = "Select * FROM DetailsT WHERE BillID = """ & DataList1.BoundText & """"
-
With Adodc2
-
.RecordSource = strQuery
-
.Refresh
-
End With
-
With DataGrid1
-
.ClearFields
-
.ReBind
-
End With
lee123
QVeen72 1,445
Recognized Expert Top Contributor
Hi,
For each TextBox, write this code in FormLoad event:
Set Text1.DataSourc e = ADODC1
Text1.DataField = "Field1"
Change control/Field names accordingly..
Regards
Veena
For each TextBox, write this code in FormLoad event:
Set Text1.DataSourc e = ADODC1
Text1.DataField = "Field1"
Change control/Field names accordingly..
OK i have done what you have said and the only one that works is the "ID" field the rest keeps giving me an error please view the code and see if i have done this right: - Private Sub Form_Load()
-
Set BillID.DataSource = Adodc1
-
Set AmountDue.DataSource = Adodc1
-
Set AmountPaid.DataSource = Adodc1
-
Set DueDate.DataSource = Adodc1
-
Set DatePaid.DataSource = Adodc1
-
Set PaymentType.DataSource = Adodc1
-
Set ReferenceNumber.DataSource = Adodc1
-
Set BillBalance.DataSource = Adodc1
-
BillID.DataField = "BillID"
-
AmountDue.DataField = "AmountDue"
-
AmountPaid.DataField = "AmountPaid"
-
DueDate.DataField = "DueDate"
-
DatePaid.DataField = "DatePaid"
-
PaymentType.DataField = "PaymentType"
-
ReferenceNumber.DataField = "ReferenceNumber"
-
BillBalance.DataField = "BillBalance"
-
End Sub
just one more question. in the properties box of each textbox do i keep them bound to the other adodc or not and there field names.
lee123
QVeen72 1,445
Recognized Expert Top Contributor
Hi,
What is the Recordsource of ADODC1..?
All the FieldNames should be present in that recordsource..
Regards
Veena
it is to a table called "BillInfo". ... Oh Maybe the "BillID" works because That Is The One Field That Is The Same In That Table. you see that's why i asked you how can i, or is it possible to do this in code with two tables in my first post i list all the fields on both tables
ADODC1 - BillID
-
BillName
-
Address
-
City
-
State
-
ZipCode
-
PhoneNumber
ADODC2 - BillID
-
AmountDue
-
AmountPaid
-
DueDate
-
DatePaid
-
ReferenceNumber
-
BillBalance
you know i thought that the datacombo was like the datalist you could use this same code: - Dim strQuery As String
-
strQuery = "Select * FROM DetailsT WHERE BillID = """ & DataList1.BoundText & """"
-
With Adodc2
-
.RecordSource = strQuery
-
.Refresh
-
End With
-
With DataGrid1
-
.ClearFields
-
.ReBind
-
End With
i guess you can't modify this code for the datacombo to work
lee123
QVeen72 1,445
Recognized Expert Top Contributor
Hi,
In that Case, Set TextBox's DataSource To ADODC2.
Since BillID is common in both the tables, it is being shown..
For others, just change the datasource..
Regards
Veena
well i tried what you have said to do but it still don't work, i have changed all to adodc2 in code and got an error then i tried to change it in the properties box but that didn't work either. these are separate tables i am using i know the id's are the same but they have different fields that's why it probably don't work. but thanks anyway for your responses i appriciate it very much..
lee123
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: serge calderara |
last post by:
Dear all,
I am develpping a .NET vb application fro 2000 and XP.
I have actually an Collection list of Type, where type have 4 variables inside
This collection list can be really long.
I then pass the content of that collection list of type to a dat grid object
which display them properly.
The content of my collection list might change, it could be more records or
|
by: msnews |
last post by:
Hi --
I'm very, very new to ASP.Net, and I've been trying for several days to
figure out how to update a datagrid AND refresh it on the client side so
that the page doesn't refresh. I've torn my code apart over and over each
time I tried what I thought would be the code that would solve my problem.
Maybe I'm going down the completely wrong path here. Essentially,
here is an explanation of my ASP.NET webform application and what I
want...
|
by: Jeff |
last post by:
IDE: VS 2003 :NET
OS: XP Pro
My app have a form with a tab-control on it. The tab-control have 2
tabpages. One of the tabpages displays a datagrid, and the other tabpage
displays details (order date, name, address etc) about the selected row in
the datagrid...
My problem is when I enter a new record in the details tabpage (saves data
to database), and go back to the datagrid. Only the data from the PM-table
|
by: Hans |
last post by:
I have a Windows.Forms.Form containing a DataGrid where the DataSource
is a DataView. Everything refreshes fine after adding, deleting or
editing rows. When I close the dialog and reopen it with a new set of
data, all is okay showing the new rows of data. But when I go back to
the first set of data, I get the correct data except for ONLY the second
column of the first row contains the data from the second set of data.
If I cause it to...
|
by: A.M |
last post by:
Hi,
I want to refresh my DataGrid data on every postback.
I have following code in Page_Load event, but after first page load, the
DataGrid never gets refresh.
Here is the code i have in Page_load (it works at first page_load):
Dim DS As DataSet
Dim MyConnection As System.Data.SqlClient.SqlConnection
| |
by: Rod |
last post by:
I posted a message to this group yesterday asking how to pass parameters to
a web form that is the source of an IFrame on a parent web form. I've
gotten my answer, and it works. Thanks!
Now I have a different problem. The web form that is in the IFrame has a
DataGrid in it. I have a button column in it which I use to trigger the
deletion of the row in the database, and I want it to also reflect that
deletion in the data grid. The...
|
by: Jennyfer J Barco |
last post by:
Hello I have a datagrid and a linkbuttom in the datagrid that says Picture,
every time I click on the link "Picture" my program opens a popup window
showing a picture of the item the selected and information about the item.
On the html of the datagrid I have the following:
OnItemCommand="Grid_CartCommand" OnItemCreated="DataGrid_ItemCreated".
My VB functions are the following:
Sub DataGrid_ItemCreated(ByVal Sender As Object, ByVal e As...
|
by: pv_kannan |
last post by:
One of our dev team members is having a strange problem with a
datagrid...
We are not seeing a datagrid's data getting refreshed after a new row
is entered in a popup window inspite of resetting the datasource and
rebinding it.
We have a datagrid (enabled viewstate) that binds to a collection class
that inherits the IList interface. The datagrid displays list of
associated contacts for a customer order.
|
by: rraw |
last post by:
hello!
i have a poblem refreshing the datagrid
the datagrid gets updated but what should i do in order to make the grid invisible once i am thru the dataviewing from the datagrid..
plz help me out
|
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: 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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
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: 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 into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
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: 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
| |