Set defaults values power Designer - designer

I am creating a physical model with power designer and I would like to add default values ​​to my Mysql table.
It is possible?, Someone added default values​​?
thanks

It is possible, wasn't easy for me to discover the "column properties"
here is how:
Select the table (one click)
Wait 1 second
select the column (another click)
Alt+enter (or right click-> properties)
Now you are editing the column properties, under the 'standard checks' tab you will find the default field.
Hope it helps

Related

Increment a number by 4, starting with a number I choose

Is it possible, if one does not want to take the AutoValue, to take as default value for a Large Integer, or even normal number, the largest value already used for this from the column and add to it?
I need an increment of 4, starting with a number I choose.
I'm using version 2016 of Office.
I found several possible solutions, which I've entered into the expression generator of the default value at Field Properties:
CODE: SELECT ALL
=Max([MyID])+1
Or
CODE: SELECT ALL
=DomMax("MyID"; "Table name")
I always get the error message:
Unknown function 'DMax' in the validity expression or default value in 'MyID.TableName'
I came across the tip that the references under VBA Editor --> Extras --> References must be correct. Here, however, I haven't the slightest idea which of these I would have to activate, if this is the problem at all.
The PrimaryKey of a table can sometimes be used as a part number in a Parts table or a userID in a Users table but otherwise is a number the user of a database should never see and certainly not manipulate. This is the first reason I suggest solution 2.
Solution 1. In Access just like with any other database I have seen that uses SQL, You can create an AutoNumber that increments by 4 using the Data Definition Language part of SQL. Maybe the Access designers considered changing the increment too rare or too advanced to put in the menu system. However, Altering the increment is not hard just open the query designer and go to the sql tab and type in appropriate SQL.
In Access 2007, how do I change the Auto Increment value?
First, Create your table as normal but don't insert any data. Then open the query designer, and open the sql pane (In this case it doesn't matter what you have in the design view as you are over writing any SQL), type
ALTER TABLE MyTableName
ALTER COLUMN MyAutoNumberColumnName AUTOINCREMENT(1,4);
The sql pane's ribbon should auto select Data Definition Language.
Run the query and solution 1 is done. When you enter Data in the table MyAutoNumberColumnName will start at 1 and increment by 4.
Solution 2: Don't use the primary key. Instead create another variable and display it. This is one example why data should be entered using forms. In the form's BeforeInsert Event calculate the variable and set it's textbox.
Private Sub Form_BeforeInsert(Cancel As Integer)
Me.txtBoxAlternateIDColumn.Value = Nz(DMax("MyAlternateIDColumn", "MyTableName") + 4, 1)
End Sub
'NZ handles the annoying case where the table is completely empty
I've used Solution 2 a couple times and I don't let the person doing data entry even see the alternateID textbox on the data entry form.
You can also use a Create Table statement in the DDL
Here is a youtube example of solution 2: https://www.youtube.com/watch?v=ZOg4P6v5ewA

The same value in all rows in Adobe Form

I created a SAP Adobe form but some fields like Price remains the same value for all of the subjects whilst it should print the respective value for each item.
I tried Modify statement but it gave nothing. Any suggestions?
Some debugging results would be nice (namely, it would be nice to know if your interface and printing program are passing correct information), but without further info I can think of 2 problems that would produce this behavior.
Error in data binding: Open design view, select table (left click top left corner), go to object palette, binding tab data binding field has to be set to your table (tablename). Select open Object palette, select binding tab and data binding field should have $.(fieldname) and NOT $.(tablename).(data)[*].(fieldname) (actual names might be different).
The above means your table element is bound to a table from context and $.(fieldname) on a row means that it is bound to a (fieldname) of a row of the table.
Second possible cause is your printing program or interface providing those details. Debug your interface, place some breakpoints and see if the internal table that contains row data has correct prices. I'm sure you know how to fix an error in code, if you find out it is an interface / program issue.

Access Database

I need help in creating an query interface with access database.
In brief, with this query interface I want to see calculated future dates for different steps of a process based on the date the process actually started.
The future dates will always be at a fixed number of days after the start date. I hope I am able to explain this in an understandable manner.
I was thinking of using access forms? Please help me in this. I am not sure of how to proceed with this.
If your data is already in MS Access, then using Access Forms would be your easiest method of displaying that data. If the data is elsewhere, such as in Sql Server, you may be better suited in the long run using a different display technology.
That being said, to select a number of dates, as you would do in Access, you can use the Date Add function. If you had a table Processes with a column StartDate, you could use the query
SELECT *, DateAdd("d",5,StartDate) as "5 Days", DateAdd("d",36,StartDate) as "36 Days"
FROM Processes
to generate a record set to bind your form to. Binding that query to a new form is easy. You just need to change the record source by:
Right click anywhere blank in your new form
Select Properties
Change to the data tab
Click the button next to the text box labeled "Record Source"
Build your query using the built in editor (or, to paste the given SQL, right click in the designer view and select SQL view, then paste)
Close the query building dialog and use your new fields. You can drag them from the field list onto the design surface.

How to update the Dataset to reflect an added column in the data source without deleting the adapter?

I've made a dataset using the dataset designer, and I'm trying to add a column to reflect changes made to the database (added a column, nothing fancy). Is there a way to 'refresh' the dataset schema from the datasource without deleting my adapter (and all the methods and queries I've created)?
I know its been a while since you posted but as I was having the same problem and figured out how to do this I reckoned I'll post the solution that worked for me.
Right click on the dataset object you want to update (on the strip at the bottom of your viewpane)
Select "Edit in Dataset Designer"
in the dataset designer, right click on the header of the table you want to add a column to
select configure... this will bring up the sql statement that is used to draw values into the dataset for this table
Edit the sql to include the column you want to include in your dataset's table and click finish i.e. in the select statement, include your columns name in the list
close the dataset designer then go to any controls (in my case its a datagridview), click on the tasks arrow (top right hand corner next to the handle) and select add column
select the newly created column from the list of databound columns and click "add"
select "edit columns" from the task menu
move the column to the correct position (it will always be placed as the last column in your grid and you may not want it to be the last column)
voila, I know its hardly snappy but it beats the hell out of deleting the dataset and then fixing up all the coding errors that come up... also after doing it a few times it'll be like second nature (I hope)
regards
p.s. am working in VS2010
Had to just delete the adapter and the table. It's rather annoying but I guess there really isn't a way around it. Maybe in VS2010 or later versions of .net.

How to populate Access Database Using Checkboxes?

I am trying to populate one column in an Access table using two check boxes - one for 0, one for 10. How do I make it so that on click or after update, whichever check box is checked populates the cell with the associated number?
Any assistance (if there's a better way to choose from two values?) would be much appreciated.
Regards,
Steve
A check box does not seem to me appropriate for selecting between 0 and 10, since
you cannot bind it as such to field in your table
it is a control commonly associated with Yes/No values
I would rather go here with an Option group (if you have enough space) or with a combo box (drop down list).
You did not mention if the field is Required nor the type of field. If field is not Required (meaning it must handle Null value), go for the Combo.
A toggle button is probably more what you're looking for. A drop down list would work as well.