Source language: Translate to:

Create database memo field not working in table view.

Questions about using NeoBook's scripting language

Moderator: Neosoft Support

Create database memo field not working in table view.

Postby Just4Fun » Sat Mar 27, 2010 4:25 pm

I give up. I've been fighting this problem with my database for several days and I can't figure out the answer.

I have two pages. One page is for the data form view and the other page is for the table view.

The memo field works fine in the data view page, but when I run the table view. All fields excepting the memo field allow data entry. The memo field says (Memo).

I call this code (based on Address Book sample) from a subroutine:


Code: Select all
:OpenDatabase_Table_Training_Records
If "[DBStatus]" "<>" "Open"
 dbfCreate "Training Records" "Date,String,35|TotalTime,String,35|Task,String,200|Comment,Memo,0" "UpdateDatabase_Grid_Training_Records"
  dbfSetColumnTitles "Training Records.dbf" "Date|Total Training Time|Training Task(s)|Comments"
  dbfSetColumnWidths "Training Records.dbf" "70|150|150|350|500"
  dbfSetTitleStyle "Training Records.dbf" "230,235,255" "Arial" "9" "Bold" "0,0,64"
  dbfSetCellStyle "Training Records.dbf" "Window" "Arial" "8" "Bold" "0,0,64"
  dbfShowTable "Training Records.dbf" "Rectangle22" "NavigationBar"
  SetVar "[DBStatus]" "Open"
Else
If "[DBStatus]" "=" "Open"
  dbfSetColumnTitles "G:\Hearing Dog Journal-Neobook\Training Records.dbf" "DATE|TOTALTIME|TASK|COMMENT"
  dbfSetColumnWidths "Training Records.dbf" "70|150|150|350|500"
  dbfSetTitleStyle "Training Records.dbf" "230,235,255" "Arial" "9" "Bold" "0,0,64"
  dbfSetCellStyle "Training Records.dbf" "Window" "Arial" "8" "Bold" "0,0,64"
  dbfShowTable "Training Records.dbf" "Rectangle22" "NavigationBar"
Endif
Return



I've also tried creating a database and putting the code in each page startup. I still get the same response in the memo field. I know this is a pain, but would someone see if this code is missing something.

TIA

Hope everyone is having a great weekend.

-Rachel
May I never be cured of my curiosity! ;-)
User avatar
Just4Fun
 
Posts: 136
Joined: Sun Dec 14, 2008 10:05 am
Location: Western Washington, USA

Postby Wrangler » Sun Mar 28, 2010 8:28 am

You have 2 if's, and an else, and only one endif. Try this:

If "[DBStatus]" "<>" "Open"
dbfCreate "Training Records" "Date,String,35|TotalTime,String,35|Task,String,200|Comment,Memo,0" "UpdateDatabase_Grid_Training_Records"
dbfSetColumnTitles "Training Records.dbf" "Date|Total Training Time|Training Task(s)|Comments"
dbfSetColumnWidths "Training Records.dbf" "70|150|150|350|500"
dbfSetTitleStyle "Training Records.dbf" "230,235,255" "Arial" "9" "Bold" "0,0,64"
dbfSetCellStyle "Training Records.dbf" "Window" "Arial" "8" "Bold" "0,0,64"
dbfShowTable "Training Records.dbf" "Rectangle22" "NavigationBar"
SetVar "[DBStatus]" "Open"
Else
dbfSetColumnTitles "G:\Hearing Dog Journal-Neobook\Training Records.dbf" "DATE|TOTALTIME|TASK|COMMENT"
dbfSetColumnWidths "Training Records.dbf" "70|150|150|350|500"
dbfSetTitleStyle "Training Records.dbf" "230,235,255" "Arial" "9" "Bold" "0,0,64"
dbfSetCellStyle "Training Records.dbf" "Window" "Arial" "8" "Bold" "0,0,64"
dbfShowTable "Training Records.dbf" "Rectangle22" "NavigationBar"
Endif

I assume this is a subroutine, and you are calling it as a sub.
Wrangler
--------------
"You never know about a woman. Whether she'll laugh, cry or go for a gun." - Louis L'Amour

Windows 7 Ultimate SP1 64bit
16GB Ram
Asus GTX 950 OC Strix
Software made with NeoBook
http://highdesertsoftware.com
User avatar
Wrangler
 
Posts: 1507
Joined: Thu Mar 31, 2005 11:40 pm
Location: USA

Postby Ndzn » Sun Mar 28, 2010 10:21 am

As Wrangler pointed out, you do have an If/EndfIf mismatch. But if I understand you correctly, you are wanting to edit a Memo field inside your Table View?

A Memo Field, as well as a Picture Field are not available for edit wthin a table. A database with these fields creates an accompanying ".dbt" file that holds the actual data for those fields. The Memo and Picture Fields in the main ".dbf" file only hold pointers to the data contained in the ".dbt" file.

If you would like to edit those fields from your table view you could, for example, create a split window where the top might contain the table, and the bottom might contain and editable form (very similar to what you have in your form view). Or, you could make a button that opens a popup window that contains a form for those fields. In any case, this "table-edit" form would give you quick access to editing the Memo and Picture fields that otherwise cannot be edited directly within the table.
User avatar
Ndzn
 
Posts: 134
Joined: Sun Sep 20, 2009 8:37 am

Postby Just4Fun » Sun Mar 28, 2010 8:34 pm

Ndzn:

Bless you! I have recreated this database at least 10 times. Just trashed everything I had done again today. Then I rebuilt it all again based on the kind help that Wrangler offered. Messing up syntax seemed exactly like what I'd expect of myself and I figured that would be the problem, but even after all of that, it didn't work. I put it aside for a while rather than deciding to destroy my computer. ;-)

You've saved me from giving up.

You guys are the best.

-Rachel
May I never be cured of my curiosity! ;-)
User avatar
Just4Fun
 
Posts: 136
Joined: Sun Dec 14, 2008 10:05 am
Location: Western Washington, USA

Postby Neosoft Support » Mon Mar 29, 2010 9:45 am

NeoBookDBPro has the ability to display memo and picture fields in a table/grid view.
NeoSoft Support
Neosoft Support
NeoSoft Team
 
Posts: 5603
Joined: Thu Mar 31, 2005 10:48 pm
Location: Oregon, USA

Postby Wrangler » Mon Mar 29, 2010 9:54 am

Just4Fun:

Coding neodbpro can be complicated at times, simply because of all the features it offers.

Believe if or not, in situations like yours, it is usually best to take the code snippet that is giving you problems, and start from scratch. This forces you to look at it again line by line (firing up the help file when needed). Also acquaint yourself with the debugger. I've found lots of unfindable problems using the debugger.

THEN, when you reach a point you get stuck, come here, explain to us what you are trying to do, and post the failing code. You usually need only post the snippet that is the culprit.

Then I'm sure we can analyze it and figure out what you're problem is.

And don't feel alone. We ALL went through this at one time or another. Stick with it and "The mystery I am, he grew plain".
Wrangler
--------------
"You never know about a woman. Whether she'll laugh, cry or go for a gun." - Louis L'Amour

Windows 7 Ultimate SP1 64bit
16GB Ram
Asus GTX 950 OC Strix
Software made with NeoBook
http://highdesertsoftware.com
User avatar
Wrangler
 
Posts: 1507
Joined: Thu Mar 31, 2005 11:40 pm
Location: USA


Return to NeoBook Action Commands

Who is online

Users browsing this forum: No registered users and 3 guests