You are viewing limited content. For full access, please sign in.

Question

Question

Database lookup is not populating a field when some of the fields in the lookup criteria are in a read-only Section

asked on April 29, 2020 Show version history

I have a simple table with a straight forward Lookup Rule to fill a currency field (also tried it with a single line field, which didn't work either) with a number from the "Balance" column, based on the Station, Battalion, Month, and Year selected in separate fields on the form.

I can't seem to get the lookup rule to fill the balance field. Below are screenshots of the database table contents, the Lookup Rule, and the form with the highlighted 'Ending balance' field that should bring up the balance from the database table.

I've done another lookup on a different form that works and was easy to set up. This one has me stumped. Any ideas?

Balance_db_table.PNG
Lookup_Rule.PNG
Form_fields.PNG
Lookup_Rule.PNG (38.24 KB)
0 0

Answer

SELECTED ANSWER
replied on April 30, 2020 Show version history

It appears that the issue was caused by setting the Section (that some of the lookup fields are in) to read-only. When I moved the Balance field outside of the read-only section, it still didn't work. When I unchecked the read-only box in the settings for the Section containing the month and year fields (which are criteria for the lookup rule), it works.

More about the lookup criteria fields... I had to calculate the previous month, and year of the previous month (in case the previous month was Dec of the previous year). On the form, the user selects the current month, and the previous month is calculated and hidden to look up the Balance for that previous month, and use it to populate the Beginning Balance of the current month.

0 0

Replies

replied on April 30, 2020

Hello Mandi, 

Did you test the exact same scenario with the same fields on that other form you set up? And what is the type of the balance column in your database? 

0 0
replied on April 30, 2020

The data type of the Balance column in my database table is money.

I have not tested it on the other form that uses a different database lookup. I will try that today.

0 0
replied on April 30, 2020

Hello mandi,

Yes please try to test it. I think it is not going to work as well. 

Try changing the data type in the database to string or integer just for the sake of trying and then the lookup rule will work perfectly. 

0 0
replied on April 30, 2020

I tried changing the data type of the Balance column. It appears that the issue was caused by setting the Section (that the balance field is in) to read-only. I unchecked the read-only box for the Section and it's working now.

0 0
replied on May 1, 2020

Oh, yeah the lookup rule was not able to read any data from the fields because the whole section was read-only. 

Glad you worked it out 

1 0
replied on April 30, 2020

For testing, add a single line field to the form and fill it with the balance.  If the single line fields fills with the lookup result, then you will need to format the output of the lookup to fill the currency field.

0 0
replied on April 30, 2020

Tried that and it didn't work either. Thanks for the suggestion.

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.