New Db building stuff
-
- BronzeLounger
- Posts: 1391
- Joined: 08 Jul 2016, 18:53
Re: New Db building stuff
Now that I have some entries I had to redesign the form, delete and create new.
ActionName displays both entries in Action table bound to column 2, but enters column 1 data.
ActionID displays both entries in Action table bound to column 1, and enters column 1 into the test box.
Control source for both is ActionName
Row source for both is Action.
How is it possible for the ActionName to populate the test box with text, not the number?
ActionName displays both entries in Action table bound to column 2, but enters column 1 data.
ActionID displays both entries in Action table bound to column 1, and enters column 1 into the test box.
Control source for both is ActionName
Row source for both is Action.
How is it possible for the ActionName to populate the test box with text, not the number?
You do not have the required permissions to view the files attached to this post.
-
- Administrator
- Posts: 78524
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: New Db building stuff
See the attached version. I removed the ActionName field from the table, since it is redundant.
The Control Source of the ActionName text box is now =[ActionID].[Column](1)
It will automatically display the description belonging to the ActionID selected in the combo box.
The Control Source of the ActionName text box is now =[ActionID].[Column](1)
It will automatically display the description belonging to the ActionID selected in the combo box.
You do not have the required permissions to view the files attached to this post.
Best wishes,
Hans
Hans
-
- BronzeLounger
- Posts: 1391
- Joined: 08 Jul 2016, 18:53
Re: New Db building stuff
I am unable to open the file unrecognized Db format.
Do you know Allen Browne(sp)?
Do you know Allen Browne(sp)?
-
- Administrator
- Posts: 78524
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: New Db building stuff
Allen Browne was a Microsoft MVP for Access; I don't know him personally but I have often used his website Allen Browne's tips for Microsoft Access
You do not have the required permissions to view the files attached to this post.
Best wishes,
Hans
Hans
-
- BronzeLounger
- Posts: 1391
- Joined: 08 Jul 2016, 18:53
Re: New Db building stuff
That's exactly what I did in between posts. Ah that's how I ran onto him.
amusing story in email.
amusing story in email.
-
- BronzeLounger
- Posts: 1391
- Joined: 08 Jul 2016, 18:53
Re: New Db building stuff
A couple of further questions
Is there a setting that forces focus to go to date on a new page in the form?
Secondly I need to calculate a value for the Amount field =[price]*[Quantity]*constant. The constant several values that may require another table where the constants are paired to the left 2-3 characters of the symbol, in both tables with a join between identical left(x) characters. Your thoughts?
Is there a setting that forces focus to go to date on a new page in the form?
Secondly I need to calculate a value for the Amount field =[price]*[Quantity]*constant. The constant several values that may require another table where the constants are paired to the left 2-3 characters of the symbol, in both tables with a join between identical left(x) characters. Your thoughts?
-
- Administrator
- Posts: 78524
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: New Db building stuff
> Is there a setting that forces focus to go to date on a new page in the form?
Do you mean when the form opens? Or when you move to a new record? Or when the user clicks a command button?
> Your thoughts?
Hard to say without knowing the details, but a lookup table is probably the way to go.
Do you mean when the form opens? Or when you move to a new record? Or when the user clicks a command button?
> Your thoughts?
Hard to say without knowing the details, but a lookup table is probably the way to go.
Best wishes,
Hans
Hans
-
- BronzeLounger
- Posts: 1391
- Joined: 08 Jul 2016, 18:53
Re: New Db building stuff
First two for sure and maybe the last.
-
- Administrator
- Posts: 78524
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: New Db building stuff
You could create an On Current event procedure for the form.
Code: Select all
Private Sub Form_Current()
Me.[Trade date].SetFocus
End Sub
Best wishes,
Hans
Hans
-
- BronzeLounger
- Posts: 1391
- Joined: 08 Jul 2016, 18:53
Re: New Db building stuff
Me.[Trade Date}.SetFocus--or does Trade Date have to be surrounded by "?
Another small issue I have [Price] set to currency 6 decimals both in the form and table, but it keeps reducing to 4 decimals. Is that fixable to 6?
Another small issue I have [Price] set to currency 6 decimals both in the form and table, but it keeps reducing to 4 decimals. Is that fixable to 6?
-
- Administrator
- Posts: 78524
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: New Db building stuff
Control names with spaces or punctuation have to be enclosed in square brackets [ ].
The Currency data type has 4 decimal places. From Currency data type:
The Currency data type has 4 decimal places. From Currency data type:
If you need more decimal places (which seems weird for currency), use Number > Double instead of Currency.Currency variables are stored as 64-bit (8-byte) numbers in an integer format, scaled by 10,000 to give a fixed-point number with 15 digits to the left of the decimal point and 4 digits to the right.
Best wishes,
Hans
Hans
-
- BronzeLounger
- Posts: 1391
- Joined: 08 Jul 2016, 18:53
Re: New Db building stuff
Pesky fractionsHansV wrote: ↑04 Jan 2023, 14:16Control names with spaces or punctuation have to be enclosed in square brackets [ ].
The Currency data type has 4 decimal places. From Currency data type:
If you need more decimal places (which seems weird for currency), use Number > Double instead of Currency.Currency variables are stored as 64-bit (8-byte) numbers in an integer format, scaled by 10,000 to give a fixed-point number with 15 digits to the left of the decimal point and 4 digits to the right.
-
- BronzeLounger
- Posts: 1391
- Joined: 08 Jul 2016, 18:53
Re: New Db building stuff
Refresh my memory of how to get to the form current properties(?) and thenHansV wrote: ↑04 Jan 2023, 10:06You could create an On Current event procedure for the form.
Code: Select all
Private Sub Form_Current() Me.[Trade date].SetFocus End Sub
Me.[Trade Date}.SetFocus--or does Trade Date have to be surrounded by "?
Where I put that code give a compile error.
You do not have the required permissions to view the files attached to this post.
-
- Administrator
- Posts: 78524
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: New Db building stuff
Open the form in design view.
Do not select anything on the form.
Activate the Event tab of the Property Sheet.
Click in the On Current event.
Select [Event Procedure] from the drop-down list in this event.
Click the builder dots (the button with ... to the right of the drop-down arrow)
Make the code look as in my previous reply.
(If your text box has a different name than Trade date, you must use "your" name)
Do not select anything on the form.
Activate the Event tab of the Property Sheet.
Click in the On Current event.
Select [Event Procedure] from the drop-down list in this event.
Click the builder dots (the button with ... to the right of the drop-down arrow)
Make the code look as in my previous reply.
(If your text box has a different name than Trade date, you must use "your" name)
Best wishes,
Hans
Hans
-
- BronzeLounger
- Posts: 1391
- Joined: 08 Jul 2016, 18:53
Re: New Db building stuff
It used to be view code IIRC, but done.
In the text box default value I have
=[Trades]![Quantity]*[Trades]![Price]*1000+[Trades]![Commission]+[Trades]![Fees]
I have'nt doen anything but will this work?
In the text box default value I have
=[Trades]![Quantity]*[Trades]![Price]*1000+[Trades]![Commission]+[Trades]![Fees]
I have'nt doen anything but will this work?
-
- Administrator
- Posts: 78524
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: New Db building stuff
Since Trades is the Record Source of the form, you don't need [Trades]!
However, the Default property will be applied when you create a new record; I assume that Quantity etc. will be empty, so the result of the calculation would be empty too.
However, the Default property will be applied when you create a new record; I assume that Quantity etc. will be empty, so the result of the calculation would be empty too.
Best wishes,
Hans
Hans
-
- BronzeLounger
- Posts: 1391
- Joined: 08 Jul 2016, 18:53
Re: New Db building stuff
Will that change as data is entered? If not then I may need an event after the last of that group is entered.
-
- Administrator
- Posts: 78524
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: New Db building stuff
The value set by the Default property will not be changed when data are entered.
Best wishes,
Hans
Hans
-
- BronzeLounger
- Posts: 1391
- Joined: 08 Jul 2016, 18:53
Re: New Db building stuff
Here is a partial image of the table without the "redundant" data. Perhaps you may see why I wanted it to populate the field.
Is there a meth to populate that field with what I have, or can add?
Is there a meth to populate that field with what I have, or can add?
You do not have the required permissions to view the files attached to this post.
-
- Administrator
- Posts: 78524
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: New Db building stuff
Remove the ActionName field from the table.
Set the Control Source of the ActionName text box on the form to
=[ActionID].[Column](1)
Set the Control Source of the ActionName text box on the form to
=[ActionID].[Column](1)
Best wishes,
Hans
Hans