recordset record position change upon the Datacombo change... 
Author Message
 recordset record position change upon the Datacombo change...

Hello,
    I got a Datacobo and bind the list to a Recordset....

datacombo1.boundcolumn = "BankCode"
set datacombo1.rowsource = Rs1
datacombo1.listfield = "BankDesc"
'I didnt set the datasource coz we just pick a value from the
list(datacombo1.boundtext)!

When I select/move/scroll the list item in the datacombo i tried to print
the boundtext .. it displayed correctly ,but when i try to get the other
column value from the same recordset (Rs1) e.g. print
Rs1.fields("BankLocation") .... It always stay at the First record !!!!!
What can i do.??

Actually I did think about to do a Rs.Find method... but It's seem it will
have problems when u use the same recordset with diff. datacmobo , is it?

Please give any opinon or solution!!Thanks
Edwin



Mon, 11 Feb 2002 03:00:00 GMT  
 recordset record position change upon the Datacombo change...
Edwin,
      If you do find the answer PLEASE E-mail me, I am having the same
problem.
      So far, no one can tell me how to fix this problem.

      Thanks,
            George

Quote:

> Hello,
>     I got a Datacobo and bind the list to a Recordset....

> datacombo1.boundcolumn = "BankCode"
> set datacombo1.rowsource = Rs1
> datacombo1.listfield = "BankDesc"
> 'I didnt set the datasource coz we just pick a value from the
> list(datacombo1.boundtext)!

> When I select/move/scroll the list item in the datacombo i tried to print
> the boundtext .. it displayed correctly ,but when i try to get the other
> column value from the same recordset (Rs1) e.g. print
> Rs1.fields("BankLocation") .... It always stay at the First record !!!!!
> What can i do.??

> Actually I did think about to do a Rs.Find method... but It's seem it will
> have problems when u use the same recordset with diff. datacmobo , is it?

> Please give any opinon or solution!!Thanks
> Edwin



Wed, 13 Feb 2002 03:00:00 GMT  
 recordset record position change upon the Datacombo change...

Quote:

> Edwin,
>       If you do find the answer PLEASE E-mail me, I am having the same
> problem.
>       So far, no one can tell me how to fix this problem.


> >     I got a Datacobo and bind the list to a Recordset....

> > datacombo1.boundcolumn = "BankCode"
> > set datacombo1.rowsource = Rs1
> > datacombo1.listfield = "BankDesc"
> > 'I didnt set the datasource coz we just pick a value from the
> > list(datacombo1.boundtext)!

> > When I select/move/scroll the list item in the datacombo i tried to print
> > the boundtext .. it displayed correctly ,but when i try to get the other
> > column value from the same recordset (Rs1) e.g. print
> > Rs1.fields("BankLocation") .... It always stay at the First record !!!!!
> > What can i do.??

> > Actually I did think about to do a Rs.Find method... but It's seem it will
> > have problems when u use the same recordset with diff. datacmobo , is it?

  I posted an answer for a similar issue with the DBCombo control this
past week.  Maybe the same idea will help you too.  Remember that your
DataCombo is loaded from the RowSource recordset;  there is no magical
connection after it is loaded.  You need to create the interaction
yourself:  in the _Change event of the DataCombo control, place the
following code:

  Rs1.Bookmark = DataCombo1.SelectedItem

  Now when you change the selected item in the DataCombo, your position
in the RowSource recordset moves to the record for the selected item -
you can then refer to any field of that particular record.
  This approach may produce unpredictable results if there are any
deletions/additions to RowSource recordset without a corresponding
ReFill/Refresh of the DataCombo.  Also, as Edwin mentioned, there will
be problems using one recordset as RowSource for two DataCombo
controls:  your position in the recordset will be based on the DataCombo
that was changed most recently (since you can't be two places at once).
Possible solution: set separate Bookmark names for each DataCombo - when
you want to reference some field for the record selected in DataCombo1,
refer to Bookmark1; for the record in DataCombo2, refer to Bookmark2.
  I hope this helps.

--
Jim in Cleveland
If you're writing to me, in my address
change "REAL_Address.see.below" to "worldnet.att.net"

"What's so funny 'bout peace, love & understanding?"
     - Nick Lowe



Thu, 14 Feb 2002 03:00:00 GMT  
 recordset record position change upon the Datacombo change...
I just had a problem like this....I have a fully
bound datacombo, I change the value, the text
changes but the datasource recordset doesn't -
until you move off the current record that is(I
can see why, but there should be a way of forcing
it).
This is a bit tedious - especially when you only
have one record in the recordset that's being
changed.
I shoved a bit of code....
rs.absoluteposition = rs.absoluteposition
before calling rs.update and it works.
Hope this helps.
Chris.

In article

  Jim in Cleveland

Quote:


> > Edwin,
> >       If you do find the answer PLEASE E-mail

me, I am having the same
Quote:
> > problem.
> >       So far, no one can tell me how to fix
this problem.


> > >     I got a Datacobo and bind the list to a
Recordset....

> > > datacombo1.boundcolumn = "BankCode"
> > > set datacombo1.rowsource = Rs1
> > > datacombo1.listfield = "BankDesc"
> > > 'I didnt set the datasource coz we just

pick a value from the
Quote:
> > > list(datacombo1.boundtext)!

> > > When I select/move/scroll the list item in

the datacombo i tried to print
Quote:
> > > the boundtext .. it displayed

correctly ,but when i try to get the other
Quote:
> > > column value from the same recordset (Rs1)
e.g. print
> > > Rs1.fields("BankLocation") .... It always

stay at the First record !!!!!
Quote:
> > > What can i do.??

> > > Actually I did think about to do a Rs.Find

method... but It's seem it will
Quote:
> > > have problems when u use the same recordset

with diff. datacmobo , is it?
Quote:

>   I posted an answer for a similar issue with

the DBCombo control this
Quote:
> past week.  Maybe the same idea will help you

too.  Remember that your
Quote:
> DataCombo is loaded from the RowSource

recordset;  there is no magical
Quote:
> connection after it is loaded.  You need to

create the interaction
Quote:
> yourself:  in the _Change event of the

DataCombo control, place the
Quote:
> following code:

>   Rs1.Bookmark = DataCombo1.SelectedItem

>   Now when you change the selected item in the

DataCombo, your position
Quote:
> in the RowSource recordset moves to the record

for the selected item -
Quote:
> you can then refer to any field of that
particular record.
>   This approach may produce unpredictable

results if there are any
Quote:
> deletions/additions to RowSource recordset

without a corresponding
Quote:
> ReFill/Refresh of the DataCombo.  Also, as

Edwin mentioned, there will
Quote:
> be problems using one recordset as RowSource
for two DataCombo
> controls:  your position in the recordset will

be based on the DataCombo
Quote:
> that was changed most recently (since you can't

be two places at once).
Quote:
> Possible solution: set separate Bookmark names

for each DataCombo - when
Quote:
> you want to reference some field for the record

selected in DataCombo1,
Quote:
> refer to Bookmark1; for the record in

DataCombo2, refer to Bookmark2.
Quote:
>   I hope this helps.

> --
> Jim in Cleveland
> If you're writing to me, in my address
> change "REAL_Address.see.below"

to "worldnet.att.net"

Quote:

> "What's so funny 'bout peace, love &
understanding?"
>      - Nick Lowe

Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


Sun, 17 Feb 2002 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. recordset record position change upon the Datacombo change...

2. recordset record position change upon the Datacombo change...

3. Record doesn't update when only datacombo changes

4. changes to all records in one rec set based on position in another rec set

5. ADO recordset position and datacombo ctrl.

6. How can I position the current record with the DataCombo Control

7. Changed at run-time recordset only shows 1 record rather than many

8. Recordset, changed at runtime, only shows 1 record

9. Changing Current Record of Related RecordSet

10. Hyperlink color changes if I click on one record of a recordset

11. Changing Current Record of Related RecordSet

12. Recordset Change Code Yeilds Error or All Records

 

 
Powered by phpBB® Forum Software