newbie - help getting values from fields in tables 
Author Message
 newbie - help getting values from fields in tables

I can create forms, etc... easily with Access. But am having problems
duplicating this within VB6. I am able to connect to a database. And I am
able to browse my database, add, and edit etc...
However, I am unsure on how to create a listbox in VB that duplicates the
functionality in Access where my field looks up data in another table.

Also, I have a field called LocalAmount. I have another called ExRate. These
are for local currency amount and exchange rate. so I can enter an amount of
$100 australian in LocalAmount field. then i can enter and exchange rate of
say 19.8 in ExRate. Thus, I would like to be able to calculate the new
amount in the new currency and enter this into a field called NewAmount. So
the answer should be $100 x 19.8 = $1980

I dont know how within Vb to get the value of LocalAmount and multiply it by
the value in ExRate and then get the answer and enter this value into the
field NewAmount within the same table.

Within Access this is easy... i just say =[LocalAmount]*[ExRate] but i cant
do this in VB.

How do i get a value within a field??

Please help! I have only just started trying to use VB to access
databases.... obviously! :)



Fri, 30 Apr 2004 11:29:13 GMT
 newbie - help getting values from fields in tables

Quote:

> I can create forms, etc... easily with Access. But am having problems
> duplicating this within VB6. I am able to connect to a database. And I am
> able to browse my database, add, and edit etc...
> However, I am unsure on how to create a listbox in VB that duplicates the
> functionality in Access where my field looks up data in another table.

What functionality does the list box have. Is it a smart search?

Quote:

> Also, I have a field called LocalAmount. I have another called ExRate. These
> are for local currency amount and exchange rate. so I can enter an amount of
> $100 australian in LocalAmount field. then i can enter and exchange rate of
> say 19.8 in ExRate. Thus, I would like to be able to calculate the new
> amount in the new currency and enter this into a field called NewAmount. So
> the answer should be $100 x 19.8 = $1980

With Recordset
    .Fields("NewAmount").Value = .Fields("LocalAmount").Value *
.Fields("ExRate").Value
End With

The above can be called prior to an update, or using a command button.

Quote:

> I dont know how within Vb to get the value of LocalAmount and multiply it by
> the value in ExRate and then get the answer and enter this value into the
> field NewAmount within the same table.

> Within Access this is easy... i just say =[LocalAmount]*[ExRate] but i cant
> do this in VB.

> How do i get a value within a field??

> Please help! I have only just started trying to use VB to access
> databases.... obviously! :)



Fri, 30 Apr 2004 12:58:02 GMT
 newbie - help getting values from fields in tables

Quote:

>> What functionality does the list box have. Is it a smart search?

The list box would look at 3 columns in another table called "Banks". So
when i clicked on the drop down menu on the list box, it would show these 3
columns, and when i selected one, it would put the value of the first column
into the field. I created this list box in Access2000 by using the Lookup
wizard.


Fri, 30 Apr 2004 15:33:12 GMT
 newbie - help getting values from fields in tables
Unfortunately, you have DISCOVERED the fact that while
they LOOK the same, many of the controls in a VB
application ARE NOT the same control that you will find in
Access.  There is no NATIVE control, in VB, that acts
like, the ListBox control that you have in Access.  The
same applies to the ComboBox controls in VB and Access, as
well.  They look the same, but the functionality is almost
totally different.  And I am unaware of ANY third party
vendor who sells VB ActiveX controls that function
identically to the Controls that you find in Access 97.

The main reason for the difference is that the Controls in
VB are all ActiveX controls, while those in Access are
not - they were developed explicitly for use in the Access
environment, by a completely different group of developers
than those that worked on Visual Basic.

Quote:
>-----Original Message-----

>>> What functionality does the list box have. Is it a
smart search?

>The list box would look at 3 columns in another table
called "Banks". So
>when i clicked on the drop down menu on the list box, it
would show these 3
>columns, and when i selected one, it would put the value
of the first column
>into the field. I created this list box in Access2000 by
using the Lookup
>wizard.

>.



Fri, 30 Apr 2004 21:12:40 GMT
 
 [ 4 post ] 

 Relevant Pages 

1. HELP: Getting parent table values who don't have corresponding child values

2. getting distinct values from one table ordered by value from another table

3. Help with getting numeric total value of fields in a row

4. Help getting Field Value

5. Help: w/ getting correct field value

6. newbie: I need to change a field value in all records in a table

7. Requesting help setting field in each record of 1 table to value in other table

8. Newbie needs help with requiring unique values in a field

9. newbie sql question about getting the minimum value

10. newbie help- Tweo Long fields in one table

11. Help on creating Tables, Fields, Etc...(newbie question)

12. Help - Writing calculated field value to table in P7 32-bit


 
Powered by phpBB® Forum Software