New Db building stuff

bknight
BronzeLounger
Posts: 1378
Joined: 08 Jul 2016, 18:53

New Db building stuff

Post by bknight »

I have a new Db with one table currently and am designing a entry form.
The design i have set to 8" the first image, the second image is what looks like in form mode slightly larger than 8"
The next item would be a drop down choice of four items for ActionName
Buy to Open
Buy to Close
Sell to Open
Sell to Close.
I another table to link when entering a value.
You do not have the required permissions to view the files attached to this post.

User avatar
HansV
Administrator
Posts: 78416
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: New Db building stuff

Post by HansV »

Did you want to ask a question?
Best wishes,
Hans

EileenStifone
NewLounger
Posts: 10
Joined: 16 Aug 2022, 05:39

Re: New Db building stuff

Post by EileenStifone »

A project starts from the correct setting of the tables based on the goal you want to achieve so you should first explain this, if the help requested is how to do it.

bknight
BronzeLounger
Posts: 1378
Joined: 08 Jul 2016, 18:53

Re: New Db building stuff

Post by bknight »

I guess I didn't explain it correctly, so here goes question 1 repeated.
I have set the width on the form to 8" see the design image, but when the form is in form view the form goes all the way across the window, not what I wanted. I want a slimmer window say around 8"
Secondly the field ActionName will have only 4 entries;
Buy to Open
Buy to Close
Sell to Open
Sell to Close.
When the field has focus/selected I would like a choice of those 4 entries either in a drop box or the software has those four in memory, if required another table could be used for those entries.
Do these ask a question/define what I'm looking for

User avatar
HansV
Administrator
Posts: 78416
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: New Db building stuff

Post by HansV »

If your database is set to display windows as Tabbed Documents (the default setting in recent versions of Access), forms will fill the entire Access window, unless their Pop Up property has been set to Yes.

If you want a specific form to be displayed in a window of the size that you have designed, set its Pop Up property to Yes.

S2079.png

If you want all forms to be displayed in a correctly sized window, select File > Options > Current Database.
Under Document Window Options, select Overlapping Windows, then click OK.

S2078.png
You do not have the required permissions to view the files attached to this post.
Best wishes,
Hans

User avatar
HansV
Administrator
Posts: 78416
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: New Db building stuff

Post by HansV »

Right-click the Action Name text box.
Select Change To > Combo Box from the context menu.

S2080.png

You now have two choices:

1) Leave the Row Source Type property of the new combo box set to the default Table/Query.
Set the Row Source property to the name of a table with 4 records and a single field that contains the 4 options.

- or -

2) Set the Row Source Type property of the combo box to Value List.
Enter the 4 options directly in the Row Source property, separated by semicolons:

Buy to Open;Buy to Close;Sell to Open;Sell to Close
You do not have the required permissions to view the files attached to this post.
Best wishes,
Hans

bknight
BronzeLounger
Posts: 1378
Joined: 08 Jul 2016, 18:53

Re: New Db building stuff

Post by bknight »

HansV wrote:
28 Dec 2022, 15:20
Right-click the Action Name text box.
Select Change To > Combo Box from the context menu.


S2080.png


You now have two choices:

1) Leave the Row Source Type property of the new combo box set to the default Table/Query.
Set the Row Source property to the name of a table with 4 records and a single field that contains the 4 options.

- or -

2) Set the Row Source Type property of the combo box to Value List.
Enter the 4 options directly in the Row Source property, separated by semicolons:

Buy to Open;Buy to Close;Sell to Open;Sell to Close
You anticipated one question!
The table still stretches all the way across the screen, even after closing and reopening. There is no X in the upper right corner to close this window.

User avatar
HansV
Administrator
Posts: 78416
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: New Db building stuff

Post by HansV »

Could you create a copy of the database with just the form, zip it and attach the zip file?
Best wishes,
Hans

bknight
BronzeLounger
Posts: 1378
Joined: 08 Jul 2016, 18:53

Re: New Db building stuff

Post by bknight »

I'm not sure how to do that without deleting the main table
The combo box doesn't show the choices just blank and I set the source to =[ActionName].[ActonName]
You do not have the required permissions to view the files attached to this post.

User avatar
HansV
Administrator
Posts: 78416
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: New Db building stuff

Post by HansV »

"Document Windows Options" is still set to "Tabbed Documents". In the attached version I set it to "Overlapping Windows" as I suggested earlier.

The Control Source of the ActionName combo box should just be ActionName, because that is the field in the record source of the form the control should be bound to.
Its Row Source should be set to ActionName because that (confusingly) is the name of the table that lists the four options - as I suggested earlier.

FutureTS.zip
You do not have the required permissions to view the files attached to this post.
Best wishes,
Hans

bknight
BronzeLounger
Posts: 1378
Joined: 08 Jul 2016, 18:53

Re: New Db building stuff

Post by bknight »

I edited it so that there would be no confusion look to the proper table. If that is incorrect so be it, thanks.
I'm unable to open the Db, indicates Unrecognized database format..
I'll need to copy mine over and attempt to follow your advice. IIRC setting the control source to just =[ActionName] resulted in the same behavior i.e. no records displayed. I guess I'll change the name of that table to Names if that isn't a Access reserved name.

bknight
BronzeLounger
Posts: 1378
Joined: 08 Jul 2016, 18:53

Re: New Db building stuff

Post by bknight »

As I remembered setting the source to ActinName did not work renaming the table to Action and the field to Name doesn't work either. i.e. -[Name]

User avatar
HansV
Administrator
Posts: 78416
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: New Db building stuff

Post by HansV »

These are the settings I changed:

S2081.png
S2082.png
You do not have the required permissions to view the files attached to this post.
Best wishes,
Hans

bknight
BronzeLounger
Posts: 1378
Joined: 08 Jul 2016, 18:53

Re: New Db building stuff

Post by bknight »

The overlapping windows is ok now, the form still is in error.
I have change the little table to Action and the field name to Name.
I have changed both the control source and row source to =[Name] and received this error

Changing to [=Action] I received a similar error.
Then changing both to Action it worked, the =[] was messing it up, and I don't know or understand the reason, however it works now.
Thanks again
You do not have the required permissions to view the files attached to this post.

EileenStifone
NewLounger
Posts: 10
Joined: 16 Aug 2022, 05:39

Re: New Db building stuff

Post by EileenStifone »

create a copy of the database zip it and attach the zip file.

bknight
BronzeLounger
Posts: 1378
Joined: 08 Jul 2016, 18:53

Re: New Db building stuff

Post by bknight »

My last entry was a conclusion to the earlier post The situation was rectified by placing Action in control source and row source not ={Action] in both.
However, a new mistake cropped up I have the drop down as the image shows (with the addition of one more record), but I now have a #Name? and will not allow any entry into this field. We're not back to square one but square two. I changed the ActionType table to Action and the field name is NameType
You do not have the required permissions to view the files attached to this post.

User avatar
HansV
Administrator
Posts: 78416
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: New Db building stuff

Post by HansV »

Hard to say without seeing the database.
Best wishes,
Hans

bknight
BronzeLounger
Posts: 1378
Joined: 08 Jul 2016, 18:53

Re: New Db building stuff

Post by bknight »

HansV wrote:
29 Dec 2022, 11:15
Hard to say without seeing the database.
I can't believe that. Anyway here is what I have, from our last exchange please tell me what/how you changed and I'll redo mine on this end.
You do not have the required permissions to view the files attached to this post.

EileenStifone
NewLounger
Posts: 10
Joined: 16 Aug 2022, 05:39

Re: New Db building stuff

Post by EileenStifone »

In the attachment you will find the modified file.
The ActionID field looks like it shouldn't be needed if you enter ActionName directly.
In the tables you should worry about managing the property Required to Yes in the fields if the entry of a data is necessary and not as now which allows you to save a record by valuing only one field, any one.
You do not have the required permissions to view the files attached to this post.

User avatar
HansV
Administrator
Posts: 78416
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: New Db building stuff

Post by HansV »

The Control Source property of the combo box was set to Action. However, the current version of the Trades table does not have an Action field; it is named ActionName instead. So you have to set the Control Source property of the combo box to ActionName.

S2085.png

P.S. As you can see in the screenshot, the Limit to List property of the combo box is currently set to No. This means that the user can type anything into the combo box and it will be accepted. If you don't want that, set the Limit to List property to Yes.
You do not have the required permissions to view the files attached to this post.
Best wishes,
Hans