I have a data sheet form linked to a table. Somtimes the table gets new fields. How can I update the form with vba so I get the new filelds in the form also.
Related
I have a subform in a MS Access frontend form that displays a datasheet. The first column contains a combo box that allows the user to select to add new items. Adding new items to the datasheet works great. Deleting the datasheet row also works great but the side effect is that the record from the lookup table I use to populate the combo box also gets deleted which I don't want to happen.
This works just fine when I have a MS Access backend DB but I have migrated to SQL backend and now this lookup table deletion is happening. How can I fix this?
I've removed all relationships between the lookup table for the combo box and the table used to populate the datasheet in the SQL backend without any success.
I have a command button on my main form that when clicked displays a datasheet view form for entering the data. I have written code before where I can add data from a single view form by adding a command button and executing the VBA code to insert values into the table.
When you have a datasheet view form, is there any way to do it differently? Also how do I create a new row automatically after the first has been entered. I am unable to enter more than 1 row at a time
A datasheet form is an alternative view of a form as opposed to single and continuous. If your datasheet form has a control source and 'allows additions' then you should not need to have a button to add a record. The new record will automatically appear at the bottom of the datasheet with a * at the left.
I am having a problem as described below.
I am developing a form which contains vb.net datagrid with several columns.
Few columns are of comboboxcolumn type which are bound to datasource of SQL Database.
Now when new entry starts, user selects data from different cell of combobox and so on.
Then all rows data from grid is saved to database.
Now if I delete a master record of one table which is the datasource of one column of datagrid,
When I open existing entry list, that particular cell is shown empty because its master data is not available in table.
How do I show deleted master data in existing entry, but not in the new entry?(Obviously it will not be available for new entry)
I would not delete the data... I would have a boolean column for redundancy. Then instead of deleting mark column as redundant = true.
The datagrid I would have with an item and edit template. In the item template would have a label which will be bound to record value. In edit template would have a combobox which would be bound to datasource where redundant = false.
I have a form that's just a list of descriptions (desc.) of other forms. Right now, when you click on a desc., the appropriate form opens; but it's done through a series of if statements in a macro. This isn't going to scale well once more forms are created.
I have a table that has the desc. and the form that is supposed to go to. I want to write a script that uses this table to open the new form based on the desc. clicked, but not using if statements. The end goal is to be able to just add a row to the table for any future forms that are created without making changes to the script or form. Is there a way to do this?
Use a combo box whose row source is a query which selects the form description and name fields from your table.
The combo will have 2 columns. You can set the width of the form name column to zero if you want to present only the form descriptions. If you make the form name column the combo's bound column, you can reference it conveniently in a DoCmd.OpenForm statement. For example, you could have a command button whose click event opens the form which is currently selected in the combo ...
DoCmd.OpenForm Me.YourComboName.Value
I have a form on which there are two subforms.In the afterUpdate() event of combobox of subform1 I want a combobox of subform to get updated with the same value and vice versa.Subform2 depends upon subform2 for its field called ID.As in if I create a new record on subform1 then the subform2 displays data based on records in subform1.New entries can be made in subform1 and modification in the data on subform2 can be made for the records in subform1.This is because subform1 brings data from the base table and subform2 gets related data from some other related tables also.
Everything runs fine if Ihave to update the comboboxes in the 2 subforms for an existing record.However,if I add a new record in subform1,then it throws error "you cannot assign a value to this object" in the afterupdate event of the combobox of subform1.Now if I navigate to subform2 and come back to subform1 and change the value of combobox, it gets updated and throws no error.
The comboboxes in both the forms have same rowsource.
Please suggest me some methods which I can use to avoid this problem.