I have my table name MyTable
And Field as follows
User | Age | Height
I added the following to the Age field (20,28,30,35)
Then i did this at subrountine
[syntax=neobook]
If "[Mydb.MyTable.Age]" ">" ""
SystemSound "SystemAsterisks"
MessageBox "Are you sure you want to continue with [Mydb.MyTable.Age]" "Yes|No" "[UserSel]"
....
EndIf
[/syntax]
Then i assigned the subrountine to the Table this
[syntax=neobook]
dbpOpenTable "DB" "MyTable" "FieldOnChange"[/syntax]
Where FieldOnChange contains the subrountine code.
But in the Grid display if i select any of the ages nothing happens.
Please am i missing something here.
Nothing Happens
Moderator: Neosoft Support
- HackinHoodLogicsTm
- Posts: 131
- Joined: Wed Aug 28, 2013 7:03 am
- Location: Ghana
- Contact:
Re: Nothing Happens
HackinHoodLogicsTm:
From the Help file ...
See what happens when ...
1) the subroutine has something simple like ...
... so you can learn when the subroutine is invoked (irrespective of what field or value is changed)
2) you make a change to another (simple text or number) field
3) navigate to another record AFTER making the change.
This set of steps will give you an idea about how things are supposed to work.
If you are confused still, post your findings here (along with definitions of your fields).
From the Help file ...
So, the question is "when is the Table considered updated" ? ... my guess is "when you/user explicitly Save the current record ... or move to another record"The name of a subroutine from your publication's Subroutine Action. The subroutine specified here will be automatically executed whenever the table is updated or the current record number changes. This can be useful if you want to activity to take place whenever the reader displays a different record. Subroutines are entered from the Actions page of NeoBook's Book Properties screen. NeoBook's help file contains more information on using subroutines.
See what happens when ...
1) the subroutine has something simple like ...
Code: Select all
AlertBox "Mydb.MyTable.Age" "[Mydb.MyTable.Age]"
2) you make a change to another (simple text or number) field
3) navigate to another record AFTER making the change.
This set of steps will give you an idea about how things are supposed to work.
If you are confused still, post your findings here (along with definitions of your fields).
- HackinHoodLogicsTm
- Posts: 131
- Joined: Wed Aug 28, 2013 7:03 am
- Location: Ghana
- Contact:
Re: Nothing Happens
Thanks Gaev for the reply.
The Alert Function should work as soon as the user make changes in the Table Field.
The table is considered Updated if the value in the field is changed without having to move into the next record.So, the question is "when is the Table considered updated" ? ... my guess is "when you/user explicitly Save the current record ... or move to another record"
The Alert Function should work as soon as the user make changes in the Table Field.
Re: Nothing Happens
HackerhoodLogicsTm:
a) when you changed the value in another field ?
2) when you picked another value from the dropdown for the Age field ?
3) after you navigated to another record ?
Did you try with the simple AlertBox command as your subroutine ? ... if so, what was the result ...The table is considered Updated if the value in the field is changed without having to move into the next record.
The Alert Function should work as soon as the user make changes in the Table Field.
a) when you changed the value in another field ?
2) when you picked another value from the dropdown for the Age field ?
3) after you navigated to another record ?
- HackinHoodLogicsTm
- Posts: 131
- Joined: Wed Aug 28, 2013 7:03 am
- Location: Ghana
- Contact:
Re: Nothing Happens
Nothing happens here too am starting to wonder if the dbpPro subrountine actually worksGaev wrote:HackerhoodLogicsTm:
Did you try with the simple AlertBox command as your subroutine ? ... if so, what was the result ...The table is considered Updated if the value in the field is changed without having to move into the next record.
The Alert Function should work as soon as the user make changes in the Table Field.
a) when you changed the value in another field ?
Nothing happens. I dont see the system sound and the alertbox
2) when you picked another value from the dropdown for the Age field ?
Nothing happens eithter. I dont see the system sound and the alertbox
3) after you navigated to another record ?
Re: Nothing Happens
HackinHoodLogicsTm:
I made a copy of the AddressBook pub sample that comes with NeoBookDBPro ... and added a line to the subroutine ...
When I ran this modified pub, the AlertBox ...
1) popped up at the start ... then I did a View >>> Grid View
2) did NOT pop up when I made changes to the Company field (even when I navigated to another field in the same record)
3) popped up when I navigated to another record
This confirms what I said in an earlier post i.e. the Table is considered updated when "when you/user explicitly Save the current record ... or move to another record".
If you are not seeing the AlertBox even after you navigate to another record, it could be because of some typo error ... make sure that your dbpOpenTable command has ...
1) the correct DatabaseID and Table Name specified
2) the specified Subroutine matching exactly with the subroutine label in the Subroutines section (except for the leading colon character)
You can also watch the Debugger to see if this subroutine is invoked/serviced when you navigate to a new record in the Grid.
I made a copy of the AddressBook pub sample that comes with NeoBookDBPro ... and added a line to the subroutine ...
Code: Select all
:DataBaseUpdate
AlertBox "AddrBook.Contacts.$RecCount" "[AddrBook.Contacts.$RecCount]"
TrackBarSetMax "TrackBar1" "[AddrBook.Contacts.$RecCount]"
SetVar "[TrackBar1]" "[AddrBook.Contacts.$RecNum]"
Return
1) popped up at the start ... then I did a View >>> Grid View
2) did NOT pop up when I made changes to the Company field (even when I navigated to another field in the same record)
3) popped up when I navigated to another record
This confirms what I said in an earlier post i.e. the Table is considered updated when "when you/user explicitly Save the current record ... or move to another record".
If you are not seeing the AlertBox even after you navigate to another record, it could be because of some typo error ... make sure that your dbpOpenTable command has ...
1) the correct DatabaseID and Table Name specified
2) the specified Subroutine matching exactly with the subroutine label in the Subroutines section (except for the leading colon character)
You can also watch the Debugger to see if this subroutine is invoked/serviced when you navigate to a new record in the Grid.
- HackinHoodLogicsTm
- Posts: 131
- Joined: Wed Aug 28, 2013 7:03 am
- Location: Ghana
- Contact:
Re: Nothing Happens
Thanks Gaev for the clarification.
I did not wanted it to action to take place upon moving to the next record. I wanted this to happen as you update the field.
I think it's time we can an update on DBPro.
I did not wanted it to action to take place upon moving to the next record. I wanted this to happen as you update the field.
I think it's time we can an update on DBPro.
-
- NeoSoft Team
- Posts: 5628
- Joined: Thu Mar 31, 2005 10:48 pm
- Location: Oregon, USA
- Contact:
Re: Nothing Happens
You can use the dbpSaveEdits action to save changes without navigating to another record.
NeoSoft Support