I'm looking to create "Welcome" window of sorts for the database I'm working on. The window would have four buttons. My current issue is with a button that I want to use to open a form I've already created.
The trick is this form is meant to be the input window to a table, so I don't want the form to come pre-populated with any data, it would (if completed) create a new record, but only once the form is completed.
Opening the form isn't the trouble (DoCmd.OpenForm "form name"), what I'm not sure is how to have it open blank.
DoCmd.OpenForm "form name",,,,acFormAdd
This opens the form to a "new" record.
If the form is bound to a table, then you can open it to a "new" record but that record is added to the database as soon as the first value is input. This doesn't fit your requirement of the record being added "only once the form is completed".
If the form is unbound, it's technically already on a blank record but you would have to create some event to save that record to the table. That event could be the OnClick event of a button, or the AfterUpdate event of a required field (although the OnClick event of a button is probably the proper method 99.999% of the time).
Related
I have a combo box in an Access form with 2 values Yes / No. The user opens the form and enters the reference number and pushes a button to run a macro. The macro executes a query to return data based on the reference number. The results of query are displayed in various text boxes.
After the combo box is built, the macro selects the appropriate value based on the query. The problem I'm having is that the "change" event is triggered because the combo box is loaded for the first time. I want to prevent this.
After reviewing the data, the user can choose to change the value in the combo box. At this time, I want the change event to fire because the additional macros are run that update multiple tables in the database.
Can I prevent the "change" event from firing when the form is loaded with data but allow it to fire when the combo box is changed?
Thanks in advance for any help or suggestions you provide........
I'm quite new to MS Access but understand basic dvl concepts. I have a form (SalesOrder) where I can create sales order info. Creating a new sales order populates more than one table.
I'd like to have a two search buttons on the bottom of the form that will display the results of a query (search by customer name or order id). The results of the query need to be displayed in a subform, and once I click on the selected row, it should populate the master form fields with read-only data (i'll have an edit button to change to writable).
Do I simply link a query to the subform? If so, how do I do that? and how do get the event in the main form (the search button click event) to trigger action in the subform?
thanks in advance.
jeff
I have a split form and when the user navigates through the records in the datasheet using the standard arrow on the bottom I want to be able to call a VBA function I wrote to populate a listbox in the top part of the form. Is there a way of doing this?
Try to use Current event.
The Current event occurs when the focus moves to a record, making it the current record, or when the form is refreshed or requeried.
I know this question has been ask thousands of time, but I couldn't find a direct answer for this problem.
I am a programmer, but I never bothered learning VBA since this is only a small project I am doing on the side. I would prefer only using macro's.
I currently have a parent form inside a navigation menu, which has a datasheet table which display all the information about all the customers.
http://i.stack.imgur.com/d3TdM.png
In this parent form, I have a button to allow the user to add a new customer which opens a pop up form.
http://i.stack.imgur.com/RDSvq.png
I want the save button in this pop up form to update the parent form onClose. I know the record is working since if I switch off to a different tab and come back to it. I can see the new record added to the table.
Put this on the form frm_addNewCustomer on close event
Private Sub Form_Close()
[Forms]![TheFormYouWantUpdated].Refresh
End Sub
I have created a very simple wpf app with mvvm light.
I have rows in a list view, these are templated representations of Book objects.
I can click a row, then click an edit button, this button loads a new window and sends the new window the book to edit (using mvvm-light's Messenger).
The issue I have is when I edit the record in my new window the data on the main form is updated. The text boxes are bound to the object received via the Messenger.
I know this is because I have essentially passed a reference to the same Book object around the place, therefore I update in one place.. and voilĂ it updates on the main page too.
What I would like to know is.. is there a standard way/method/concept to achieve what I am trying to do? i.e. create an "edit" page/screen with the option of discarding the edits?
thanks.
Could you make your entity implement ICloneable and create a clone for editing?