Topic: "Not a valid integer" error

Hello,
I am getting the above error when I click Button1 in the form AA_003_Participants. What is going wrong and how to overcome it? Please help.

Post's attachments

Attachment icon Classmates.zip 346.32 kb, 5 downloads since 2020-05-21 

2 (edited by eyeman303 2020-05-21 05:32:27)

Re: "Not a valid integer" error

One more issue is with tablegrid header. On launching the app, the headings in the tablegrid are skewed towards left and there are extra empty columns on the right. How to fix this?
Regards,
Eyeman

Post's attachments

Attachment icon TG_Header.JPG 35.56 kb, file has never been downloaded. 

Re: "Not a valid integer" error

eyeman303 wrote:

One more issue is with tablegrid header. On launching the app, the headings in the tablegrid are skewed towards left and there are extra empty columns on the right. How to fix this?
Regards,
Eyeman

Hello eyeman303,

The header issue is fixed with script, and the error is caused by trying to add items with relationships without selecting the item it is related to.  If you create the project then you must enter the project name before adding the participants.

If you want to add a contribution then you must have selected a Participant name.  If not then it doesn't know which Participant to associate the contribution with.

I have made a couple of modifications to your project to help get you started.

1. I  set two of your database fields to Not Null to prevent your integer error 

2. I enabled the script and put some examples for you to be able to use to fix your column widths.

I hope this helps.

If not then there are awesome people on here that will help you out.  Good luck!!!

Post's attachments

Attachment icon Eyeman303 Classmates.zip 586.63 kb, 11 downloads since 2020-05-21 

Sonny.

Re: "Not a valid integer" error

Hello sdhale29,
Thanks a lot. You have explained clearly and made my concepts better. Your modifications have made the app work perfectly. One thing I would like to know, whether it is possible to fit the tablegrid header to the tablegrid width, regardless of the number of columns?
Regards,
Eyeman

Re: "Not a valid integer" error

eyeman303 wrote:

Hello sdhale29,
Thanks a lot. You have explained clearly and made my concepts better. Your modifications have made the app work perfectly. One thing I would like to know, whether it is possible to fit the tablegrid header to the tablegrid width, regardless of the number of columns?
Regards,
Eyeman


I have attached a project with two examples.

Form1 is for single column

Form2 is for multiple columns

Post's attachments

Attachment icon Eyeman Header.zip 584.15 kb, 13 downloads since 2020-05-21 

Sonny.

6 (edited by derek 2020-05-21 23:29:29)

Re: "Not a valid integer" error

Hi sdhale, eyeman,
There are also options for autosizing columns depending on the column header, the data in the column, or both, which might be of help with your project.  Please see the attached (pinched from sdhale - sorry!) for examples.
Derek.

Post's attachments

Attachment icon Eyeman Header2.zip 339.67 kb, 18 downloads since 2020-05-21 

Re: "Not a valid integer" error

derek wrote:

Hi sdhale, eyeman,
There are also options for autosizing columns depending on the column header, the data in the column, or both, which might be of help with your project.  Please see the attached (pinched from sdhale - sorry!) for examples.
Derek.


wink Derek y'all are way better at this than I am.  Take over any time.  I appreciate you guys

Sonny.

Re: "Not a valid integer" error

Hello Derek and sdhale,
Great solutions. Learning is a joy when teachers like you show the path. My table grids will definitely look better now.
Thank you,
Eyeman

Re: "Not a valid integer" error

Hi,
I am facing 2 more problems.
1. A script error appears while trying to define column widths according to data.
2. Search button (Button1) in the form DB_003_Contacts is not working.
Please help.
Regards,
Eyeman

Post's attachments

Attachment icon classmates_05_error.7z 424.01 kb, 5 downloads since 2020-05-23 

10 (edited by eyeman303 2020-05-23 07:12:50)

Re: "Not a valid integer" error

Hi,
I have figured out the script error. There was a duplication of procedures. Corrected the same. Still problem 2 persists.
Regards,
Eyeman

11 (edited by derek 2020-05-23 17:00:12)

Re: "Not a valid integer" error

As far as I can tell, the search button on form db_003_contacts is working okay. 
I suspect you've only done a basic test with a record that has only skype and/or email contact details which are held on AA_001_Classmates. 
Since your search button is defined to use AA_005_Phone_No as its starting table for the query, it's obviously not going to find anything (as no record at that point exists in AA_005_Phone_No!).   
I notice that you are using calculated fields to shuttle the email and skype details across to AA_005_Phone_No but again, this will only work if the relevant record in AA_005_Phone_No already exists.
A further issue is that the combobox list enables you to select a record from AA_001_Classmates even though there is no associated AA_005_Phone_No record.  Is that how you want it to work?
Also, I'd advise ticking the 'allowgrayed' option for your checkbox otherwise the query won't work exactly as it should, but it's up to you. 
Add phone and/or whats app details and the query should start working.
It is however, a bit confusing to me why you are holding contact details in different tables (among other things). 
As always (and this isn't an MVD issue), if your data structure is not optimal, you are just storing up problems and complexity.
Derek.

Post's attachments

Attachment icon eyeman5.zip 511.41 kb, 11 downloads since 2020-05-23 

12 (edited by eyeman303 2020-05-23 18:51:52)

Re: "Not a valid integer" error

Hello Derek,
Thanks again. Initially the query worked but  then it stopped working in spite of the table AA_005_Phone_No having data. All were Phone numbers with WhatsApp ticked.  I removed the checkbox from the search query and now the query works.
I moved the email and skype to the table  AA_005_Phone_No and this removed the need for calculated fields. I added email and skype fields in the form AA_005_Phone_No. However,I am concerned that, if a person has 2 phone numbers but 1 email, the second record will have a null value in the email field.It was for this reason, only phone numbers were stored originally in the table AA_005_Phone_No and e-mail/skype in the table AA_001_Classmates.   
One more doubt. There is a maximum of 12 image database files per person. If there are 100 classmates and 1200 images, how would the app run? Linkfile option may not be viable here, as the app need to be shared.
Regards,
Eyeman

Post's attachments

Attachment icon changes_made.7z 55.94 kb, 3 downloads since 2020-05-23 

13 (edited by derek 2020-05-23 19:58:14)

Re: "Not a valid integer" error

Hi,
I thought the issue of multiple phone numbers and/or multiple whats app IDs might have been the reason for your AA_005_Phone_No table.  But by the same logic, isn't it possible for someone to have multiple emails and skype IDs (I do!).
Perhaps an option might be to have, instead of AA_005_Phone_No,  a more general purpose "Contacts" table with a lookup to a "Contacts_Type" table (landline, mobile, skype, whats_app, email etc) which would allow you to have none, one or multiple contact details of any type held in "Contacts". 
But I don't know how well that may or may not fit in with what you've already done.
I would definitely be holding images outside of the application using the linkfile option.  If the app is shared, wouldn't you just link to images in a folder on a shared drive?
Derek.

Re: "Not a valid integer" error

Hello Derek,
I have understood that it's the right way to do it. I have changed the tables and forms accordingly but now  "List index out of bounds(3)" error crops up, while trying to search in the form DB_003_Contacts.How to correct it? Please help.
Regards,
Eyeman

Post's attachments

Attachment icon classmates_10.zip 397.24 kb, 6 downloads since 2020-05-24 

15 (edited by derek Yesterday 10:54:26)

Re: "Not a valid integer" error

In DB_003_Contacts, your search button selects 3 columns to output to the tablegrid.
But in your script (line 62) you are still referring to a 4th column that no longer exists.(which causes the 'list index out of bounds' error (see attached screenshots)).
Derek.

Post's attachments

Attachment icon eyeman10.zip 418.56 kb, 11 downloads since 2020-05-24 

Re: "Not a valid integer" error

Hello Derek,
I cannot thank you enough!  I have made the correction that you highlighted so precisely and the app is now working perfectly. I have also made a folder for all the photos in the programme folder itself and linked all photos.
Regards,
Eyeman