Re: Writing data from a table to another
- From: "max" <max@xxxxxxx>
- Date: Tue, 6 Feb 2007 15:56:12 +0100
Hi,
it works, Robin, thanks.
However I'd like to use a textbox in place of a combobox, because this field
should not be editable by operator, and even if I disable it from properties
the down arrow remains visible and it's not so elegant.
How can I use the same bindings you suggested for a combobox in a textbox,
if applicable?
Thanks,
Max
"RobinS" <RobinS@xxxxxxxxxxxxxxx> ha scritto nel messaggio
news:EtidnWPktfs6k1vYnZ2dnUVZ_oytnZ2d@xxxxxxxxxxxxxx
Am I reading this right, that the problem is that the DoctorsName is not
stored in the [Listing] table ? Is that the problem you are having?
You need to bind the combobox to the TblPatientsBindingSource for display,
but you need to set the SelectedValue to ListingBindingSource/DoctorName.
If you have the Listing table in a data source, you can just drag the
[doctorname] from the listing table over and drop it on the combobox you
have already bound to the TblPatientsBindingSource, and it will do the
double-binding for you.
You can double-check this in the Code-Behind -- show all files (click the
icon in the Solution Explorer) and look at the myform.designer.vb code for
your combobox. It should have DisplayMember and ValueMember pointing at
TblPatientsBindingSource, but SelectedValue should point at
ListingBindingSource.
BTW, next time you post, please put some paragraphs in your message. Most
people won't read a 35-line paragraph. You'll get more help if you
separate it out better.> Robin S.
Thanks,
Ts'i mahnu uterna ot twan ot geifur hingts uto.
-----------------------------------------------
"max" <max@xxxxxxx> wrote in message
news:Pfiwh.1753$wO2.600@xxxxxxxxxxxxxxxxxxxxxxxx
Yes Robin, I have a question:
[CUT] I need the items are written in this table in the explicit way (and
actually the DoctorName is not written at all), because then I need to
let operator to perform many queries on it, and he must selects the
doctors and the patients by name, not by an ID.
How can I do this?
Thanks.
Max
"RobinS" <RobinS@xxxxxxxxxxxxxxx> ha scritto nel messaggio
news:bLmdncpYn8BFMVzYnZ2dnUVZ_vShnZ2d@xxxxxxxxxxxxxx
Did you have a question, or are you just sharing?
Robin S.
----------------------------------------
"max" <max@xxxxxxx> wrote in message
news:%H1wh.516$wO2.426@xxxxxxxxxxxxxxxxxxxxxxxx
Hello,
I'm working on an Access db in VS2005. I have a table, called
tblPatients, in which I have three columns: PatientID (primary key),
PatientName and DoctorName. This table is filled with more than 4.000
records. I load this table on a form, I make queries, updates,
deletion, it does work fine. Then I have a second form, in which I need
to display the two main columns from tblPatients (PatientName and
DoctorName), and some more elements: medical visits performed (till 5
in the same day), date, fares for each visit, total amount, and a
discount field. The operator starts selecting the Patients from a
ComboBox, which displays automatically its DoctorsName field; it's fine
because the operator doesn't need to choose manually the doctors! This
form loads a second table, called Listing. The columns in this table
are:
ListingID (primary key), PatientsID, DoctorsName, Date, Fare1... Fare5,
Total, Discount. I need all these elements are written in this second
table.
Well, I have noted that almost all these elements are written, but the
items belonging to "DoctorName", coming from the previous table
(tblPatients), are not physically written in this table, just displayed
(correctly), and the items belonging to "PatientName" are written only
in the "PatientID" form
(numbers). I have used a ComboBox for PatientsName, bounded to:
Data Source: tblPatientsBindingSource; Display member: PatientName;
Value: PatientID; Selected Value: ListingBindingSource - PatientID.
Then I have used a TextBox for DoctorName, bounded to:
TblPatientsBindingSource - DoctorName.
I need the items are written in this table in the explicit way (and
actually the DoctorName is not written at all), because then I need to
let operator
to perform many queries on it, and he must selects the doctors and the
patients by name, not by an ID.
I didn't write any lines of code, all is written by designer.
Thanks
Max
.
- Follow-Ups:
- Re: Writing data from a table to another
- From: RobinS
- Re: Writing data from a table to another
- References:
- Re: Writing data from a table to another
- From: RobinS
- Re: Writing data from a table to another
- From: max
- Re: Writing data from a table to another
- From: RobinS
- Re: Writing data from a table to another
- Prev by Date: Re: Saving changes from DataGridView into database
- Next by Date: Re: Database Update using dataset
- Previous by thread: Re: Writing data from a table to another
- Next by thread: Re: Writing data from a table to another
- Index(es):
Relevant Pages
|