Source language: Translate to:

Showing more than one field at a time

Questions about our Advanced Database plug-in

Moderator: Neosoft Support

Showing more than one field at a time

Postby DELCO » Fri Aug 30, 2013 4:18 pm

Hello to all,

I don't know if i will be very clear, sorry :

Imagine you have a database with 3 fields ("name","phone","city") and you have 4 records.

Now, you have 4 buttons, and the caption of each button is a variable, the "name.field"

How can I have button 1, with "name" record 1 as caption, button 2, with "name" record 2 as caption, button 3, with "name" record 3 as caption, and button 4, with "name" record 4 as caption,
Is it possible ?

Regards,
User avatar
DELCO
 
Posts: 132
Joined: Fri Apr 01, 2005 9:12 am

Re: Showing more than one field at a time

Postby Gaev » Fri Aug 30, 2013 6:05 pm

DELCO:

I am not sure where the phone and city fields fit into your requirement.

You use ...

1) dbpFirst and dbpNext commands to navigate from the first to the 4th record

2) SetObjectCaption to set the caption of a Button

3) [MyDB.myTable.name] to get the value of the name Field (Assuming that your Database is called MyDB and the Table is called MyTable)

Assuming that you are familiar with other aspects of using Databases (like opening and closing databases and tables) ... your code might look something like this ...
Code: Select all
dbpFirst "MyDB" "MyTable"
SetObjectCaption "PushButton1" "[MyDB.MyTable.name]"
dbpNext "MyDB" "MyTable"
SetObjectCaption "PushButton2" "[MyDB.MyTable.name]"
dbpNext "MyDB" "MyTable"
SetObjectCaption "PushButton3" "[MyDB.myTable.name]"
dbpNext "MyDB" "MyTable"
SetObjectCaption "PushButton4" "[MyDB.MyTable.name]"
User avatar
Gaev
 
Posts: 3738
Joined: Fri Apr 01, 2005 7:48 am
Location: Toronto, Canada

Re: Showing more than one field at a time

Postby DELCO » Sat Aug 31, 2013 2:11 am

Hello Gaev,
Thank you for your prompt answer.
I will try this today.
Thank you again, and have a good day !
User avatar
DELCO
 
Posts: 132
Joined: Fri Apr 01, 2005 9:12 am


Return to NeoBookDBPro

Who is online

Users browsing this forum: No registered users and 2 guests

cron