MS Access Form Text Boxes Freeze - textbox

I have a weird situation with my MS Access 2016 split database.
The back-end is a Azure SQL server DB, the front-end are distributed accde files.
I have a form bound to a linked table with several sub-forms in it.
The form is used to edit single records of the main table.
With some records all works fine ("good") but with some other records ("bad") the text boxes freeze, not allowing any edits.
No error messages, they just seem to be locked but the locked property of the text boxes control is set to false. (I've checked this in runtime)
What I've tried so far:
I can edit all records directly in the linked table
The properties of the form and controls in both "good" records and
"bad" records are the same
I can change the values of check and combo boxes and update the "bad"
records
The BIT column has a default value of 0 and nulls are not allowed (no
NULLS in the table for this field)
I'm running out of ideas. Any help will be much appreciated.

I've figured it out, so i'll leave the solution in case someone hits the same issue.
I have a subform with a browser control. All i had to do was to add the following line at the end of the main form loading sequence:
Me.SF_WEB_BROWSER.SetFocus

Related

Delphi FireDAC: how to refresh data in cache

i need to refresh data in a TFDQuery which is in cached updates.
to simplify my problem, let's suppose my MsACCESS database is composed of 2 tables that i have to join.
LABTEST(id_test, dat_test, id_client, sample_typ)
SAMPLEType(id, SampleName)
in the Delphi application, i am using TFDConnection and 1 TFDQuery (in cached updates) in which i join the 2 tables which script is:
"SELECT T.id_test, T.dat_test, T.id_client, T.sample_typ, S.SampleName
FROM LABTEST T
left JOIN SAMPLEType S ON T.sample_typ = S.id"
in my application, i also use a DBGrid to show the result of the query.
and a button to edit the field "sample_typ", like this:
qr.Edit;
qr.FieldByName('sample_typ').AsString:=ce2.text;
qr.Post;
the edition of the 'sample_typ' field works fine but the corresponding 'sampleName' field is not changing (in the grid) after an update.
in fact it is not refreshed !
the problem is here: if i do refresh of the query, an exception is raised: "cannot refresh dataset. cached updates must be commited or canceled
and batch mode terminated before refreshing"
if i commit the updates, data will be sent to database and i don't want that, i need to keep the data in cache till the end of the operation.
also if i get out of the cache, data will be refreshed in the grid but will be sent to the database after qr.post and i don't want that.
i need to refresh data in the cache. what is the solution ?
Thanks in advance.
The issue comes down to the fact that you haven't told your UI that there is any dependency on the two fields - it clearly can't know how to do the join itself without resubmitting it so if you don't want to send the updates and reload you will have a problem.
It's not clear exactly what you are trying to do, but these two ideas may help you.
If you are not going to edit the fields in the SAMPLEType tables (S) then load the values from that table into a lookup table. You can load this into a TFDMemTable. You can use an adapter which loads from a query. Your UI controls can then show the value based on the valus looked up in your local TFDMemTable. Dependiong on the UI control this might be a 'LookupField' or some such.
You may also be able to store your main data in a TFDMemTable with an Adapter - you can specify diferent TFDCommands to read the whole recordset, refresh a record, update, insert and delete a record. The TFDCommands can act on multiple tables for joined recordsets like this. That would automatically refresh the individual record for you when you post it.

Auto-deleted Repeated sections

I created a Orbeon form that contains repeated sections that are filled in with data saved under form-resources in the source code. As usual, I use the functionality 'calculated value' with a xPath expression to fill in a field.
After I created the form, I made a survey. If I close the form without saving it and reopen it,
then no repeated sections are displayed anymore.
Is there a way to avoid the deletion of repeated sections in this case?
Thanks a lot for your help.
bjn

Access 2010 form not displaying query

I'm sure this is an easy fix but I can't seem to find it. I just have a form, that will be a subform of another, that needs to display the results of a query.
The query is simple enough, just displays all fields of records that fall between specified dates. The query works great, but when I attach it to the form as its record source it doesn't display the data. I can see the correct amount of record selectors so I know its understanding the query but its as if all fields are hidden!
I have also tried building a query to the forms record source that was simply Select query.* From query. Oddly I have had this working before but I had to specify every field. What I mean is:
Select title From query
Select type From query
Select date From query
...
And so on for all the fields but this seems foolish, can anyone think of what I may be doing wrong?
Thanks in advance!
Edit, forgot to mention I also tried the foolish solution that I mentioned above and it didn't work so its definitely some issue that I'm not seeing, some property that's probably not appropriately set
#sshekhar well its not really code at the moment I'm using Access 2010. I have a form that needs to display a subform that executes this query of displaying records that have a data field that fall between dates specified by the user. The query works and displays the correct records, but the form that it is attached to only shows the record selectors and all the fields appear to be "hidden." I thought it may be one of the form's properties set incorrectly but I checked on the test form from another database that I used and each have what appears to be identical settings. So I'm at a loss!
So it turns out even though I using a query that holds all the fields it will not display the content unless you go to the Add Existing Fields and add all the the fields you want to see. This seems really silly especially when the results in the query but at least its working now.
I had this problem and discovered that having the property DataEntry set to YES will only display new records. From Microsoft Help:
You can use the DataEntry property to specify whether a bound form
opens to allow data entry only. The Data Entry property doesn't
determine whether records can be added; it only determines whether
existing records are displayed. Read/write Boolean.

New to Visual FoxPro- my textboxes are greyed out and inaccessible

I'm attempting to create a Visual FoxPro standalone application that will take two inputs from a user (old location and new location). It will have two tables with a 1:M relationship with primary and foreign keys matching the old location. The application should then replace all instances in both tables of the old location with the new location.
I've put the form together and got the fields in both tables displaying in grids, both textboxes present and an "Update Records" submit button.
My problem is that my textboxes are greyed out when I select "Form">"Run Form" and I can't input anything.
Does anyone have any ideas why the boxes would be greyed out? I checked in Properties > Data > Read only and they are both marked as .F.
Thanks so much for your help!
*edit: Figured it out- Had ControlSource on because I thought that would bind the input to a specific field in a specific table. Never mind! :)
Figured it out- Had ControlSource on because I thought that would bind the input to a specific field in a specific table. Never mind! :)
Kate
Just as an aside. the text boxes can be greyed out for a number of reasons, the most obvious ones are property set to readonly = .t. or enabled = .f., but also if the text box is bound to a datasource and that source is not available.
i.e the table EMPTY or is EOF() or BOF()

Delphi Search Edit Component

I need a delphi component for Delphi 2007 win32 that have features like Google search text box.
** While User writing search key it should fill/refresh the list with values, and user can select one of them.
**User can go up and down list and can select one of them.
**List should contain codes and text pair, so user can select text and I can get code for database operations.
(Google can highlight the search text in List but I think it is not possible with Delphi 2007, so it is not expected.)
I tried Dev Express TcxMRUEdit, however it doesn't meet my needs
Since you have DevExpress, why don't you try the cxLookupComboBox in lsEditMode and with ImmediateDropDown = True?
Check out woll2woll components. The TLookupcombobox has done this since Delphi 3 (or earlier). This is not spam, I just use the library.
http://www.woll2woll.com/
I also had the same problem and unfortunately didn't find a suitable component. I was also inspired from google.
So it turned out to be easier for me to "simulate a component" by using an editbox and a grid placed under it. As the user types something in the editbox the query refreshes and the proper resulst are shown in the grid. I have many columns in the grid, the query results try to match all the fields (so if I type 'po', the query will return all records where any field is like 'po%'). I also added a delay of 500ms after the user types to avoid to run too many unnecessary queries (another aproach could be to kill the thread as the user strikes a new key, if the query is run in a thread).
In this way I obtained the required functionality, even if without higlighting the search text, anyway my users are delighted by this.
In every place I am using this "component" I am attaching a query at runtime so it can be used in many different forms.
I somehow was also inspired by the skype UI: when you display the lsit of contacts you can type something and the contacts will be filtered accordingly (skype uses an editbox + grid/listbox).

Resources