Base: Added field to form

I created a database using the Table Wizard for “Contact” and added two fields to it. Whenver I enter anything in either of the two new fields, I get a “0.” I went to the design of the field in the database and it reads correctly, that the field is supposed to have 100 text spaces.
Also, I created a query with all of the data in the right order. How do I ensure that the form is connected to the query and not to the original database?
Thanks!

It sounds like the form controls in question are numeric controls. I replicate the same functionality – a display of 0 on a text field (actually, 0.00) when viewed through a numeric control. In design view for the form, enter the control properties box. Confirm type by title in heading. In form navigator, Icon 123 also will be displayed.

Hmm, many thanks. I checked and sure enough, if I enter numbers, it works fine. It’s only when I enter text that it imediately becomes a zero. Checked the data file and it reads “Text [VARCHAR]” and the format of the form field and that reads “@” so I’m not at all sure where the problem could be.

That is a formatted field, with the correct format code for text formatting … and I confirm it does not work for me also. However, it is unnecessary to use formatted field, instead use a text control.

To fix it all you need to do is to convert the formatted field controls that display zero back to text field controls. Open the form in design view (edit mode), right mouse click on the control in question and use menu entry replace with. At the top of the list you should see text box. Click that, it should work.

There are other control properties to consider as well, visible in the control dialog box, but the data source should remain unchanged in the operation above. Save, toggle design mode on/off and it should work as intended.

Re-did the form with a wizard. It was based on a query that organized the data just the way I wanted it and all the fields came out in the order I wanted them. Problem: I can’'t edit anything! I can’t change any of the data via the form, which kinda defeates the whole purpose of having a form in the first place!
Completely appreciate people’s efforts here, but man, dBase 5.5 (A 90s program) was SO much easier! It was simple and straightforward and you could understand everything!

Some possibilities that might apply: table needs a primary key, query with joins may be non-updatable, and form properties data should have Allow modifications yes, properties of individual controls should not be read only and should be enabled. Sounds like query wizard is not doing the right thing.

So the primary key should be a single column/data element? Hmm, yeah, I can do that. Thanks!

%$#@$!!! I added a field and then clicked on the option to make it my primary key. It then told me it couldn’t accept my key and suggested a way to make a primary key that didn’t work. Sigh!! I guess I have to mak the whole database from scratch AGAIN!!!

I can’t speak to your specific problem, but if the table does not have a primary key, the key itself can be added to an existing row by right mouse clicking on the left side selector in edit mode, and then selecting the option primary key. The column will need to have unique data. The HSQLDB guide says that multi-column primary keys are supported, but I don’t see a way in the LO user inferface.

Many thanks for your patience on this. Adding the extra column/data element is simple. It’s turning it into a primary key that’s kicking my butt. When I tried to make it into a primary key, it says that it will do something automaticaly involving deleting the column and re-creating it so that it’s a good primary column. Then it says it can’t delete the column. I can delete it, but then I have to start all over again.

Hmm, is there some way to access the Base SQL code directly? I go into HTML code and fool around “under the hood” all the time. Can I do it with Base?

Yes, you are right. The ‘under the hood’ tool is available through menu option ToolsSQL, and in addition the command you are looking for is ALTER TABLE "Table1" ADD PRIMARY KEY ("column1", "column2") It tests ok on my end, both columns are displayed in UI as primary. Alternately, see instructions in LO guide appendix for extracting LO database into HSQLDB external– not for the faint of heart.

Awesome ! Thanks!