Save and create new record (1 Viewer)

Machino

Registered User.
Local time
Yesterday, 22:04
Joined
Mar 26, 2019
Messages
13
Hi All
I am a newbee (somewhat). I recently created a new database for a client. The problem I am encountering is that I would like to start a new record once I have selected the save button. Once the user starts to fill out the form a PO# is automatically generated. After the user has has filled out the form they select the save button to record the entry. Currently, I am able to save but not blank out the fields.

Next, I have 3 other tabs that are used to store Clients, Vendors and Staff names which are then used to populated combo dropdown lists on the PO Entry form. If some could help me setup one of these correctly I can most likely figure out how to do the rest. I am uploading the database I am working on. Any help is greatly appreciated. Thank you
Machino
 

Attachments

  • Strathmoor Electric PO.accdb
    1.9 MB · Views: 40

mike60smart

Registered User.
Local time
Today, 03:04
Joined
Aug 6, 2017
Messages
1,904
Hi Machina

All you need on your PO Form is an Add New PO Button

All the Other tabs just needed the Forms added correctly to each specific Tab.

I would recommend that you do NOT use the PO_ID as your Purchase Order Number.

The PO_ID is an Autonumber and should only be used to uniquely identify each record in the PO Table.

You should have a field specifically to record each Purchase Order Number. This can be added automatically in Access by using the following example:-

In the Before Insert of the Form

Me.InvoiceNr = Nz(DMax("InvoiceNr","tblCustomerOrderdates"),0) + 1


View attachment Strathmoor Electric PO.zip
 

Machino

Registered User.
Local time
Yesterday, 22:04
Joined
Mar 26, 2019
Messages
13
Hi mike60smart


Thank you very much for you suggestions and help. I was able to incorporate a great of comments and make them work. I added a new field in my PO_HISTORY table to address the PO number (PO_NO) while leaving the PO_ID as the primary key. At the moment I have two issues that I cannot make work. I set the PO_NO with a start value of 4000 and I placed the code you suggested (with the appropriate changes) in the Before Insert event but it did not work. Can you take a look this and let me know where I went wrong. Two, on the CLIENT, VENDOR and ORDERED BY forms I would like to hide the rule bar on the left. I am attaching the updated database. Again, thank you very much for you assistance with this.
Machino
 

Attachments

  • Strathmoor Electric PO-3-26-2019.zip
    542.1 KB · Views: 52

mike60smart

Registered User.
Local time
Today, 03:04
Joined
Aug 6, 2017
Messages
1,904
Hi Machino

The db has been updated.

To hide the Rule Bar on the Left of the Form you need to set the properties of the Forms to those shown in the attached:-

Properties.JPG

The generation of the PONr is achieved by using the Before Update and you did not need a default value of 4000 in the table field

View attachment Strathmoor Electric PO-3-26-2019.zip
 

Machino

Registered User.
Local time
Yesterday, 22:04
Joined
Mar 26, 2019
Messages
13
Hi mike60smart


Thanks for the updated database and the jpeg with the settings for turning off the side bar. I tried incorporating the changes you made to my more recent file and for some reason I am getting a method error on the PONr. All of the fields have been renamed and configured to match what you had sent me. I will not work on this database until I get your comments back. Aside from getting the PO feature to increment correctly, I am having trouble with two I believe minor issues. I added a print preview feature based on a query. It was working fine but now it isn't. The other is that I generated a report and two of the field are showing up as numbers instead of names. I know why this is happening but I tried adding a Dlookup to the report field (as you will see) with no luck at all. Thanks a mil for your help with this.
Machino
 

Attachments

  • Strathmoor Electric PO-3-27-2019.zip
    724.5 KB · Views: 44

Machino

Registered User.
Local time
Yesterday, 22:04
Joined
Mar 26, 2019
Messages
13
Re: Save and create new record
Hi mike60smart
I see what you have done and it has resolved most of the issues. The only thing that is not working properly is that you select the Print Report button a syntax error message appears (see attached jpeg). Also, do you know why the date function in the report is not displaying correctly. Thanks a mil. I really do appreciate your help with this.

Machino
 

Attachments

  • syntax error message.JPG
    syntax error message.JPG
    17.5 KB · Views: 37

mike60smart

Registered User.
Local time
Today, 03:04
Joined
Aug 6, 2017
Messages
1,904
Hi Machino

I placed an On Click Event on the Command Button to Preview with Report based on the current PO_ID on the Form

Check that this code is on your version
 

Machino

Registered User.
Local time
Yesterday, 22:04
Joined
Mar 26, 2019
Messages
13
This is the code I found in the On click event. Thanks.



Private Sub Command125_Click()
On Error GoTo Command125_Click_Err

If Me.Dirty Then Me.Dirty = False

DoCmd.OpenReport "PO_HISTORY", acPreview, , "[PO_ID]=" & Me.PO_ID


Command125_Click_Exit:
Exit Sub

Command125_Click_Err:
MsgBox Error$
Resume Command125_Click_Exit

End Sub
 

mike60smart

Registered User.
Local time
Today, 03:04
Joined
Aug 6, 2017
Messages
1,904
You have to make sure that PO_ID is actually included in your Report
 

mike60smart

Registered User.
Local time
Today, 03:04
Joined
Aug 6, 2017
Messages
1,904
Hi Machino

It would probably help if you uploaded your actual Db
 

Machino

Registered User.
Local time
Yesterday, 22:04
Joined
Mar 26, 2019
Messages
13
Hi mike60smart
Here's the latest DB. The [PO_ID] is in the report. I'm not sure what's going on. Thanks.

Machino
 

Attachments

  • Strathmoor Electric PO-3-27-2019.zip
    748.3 KB · Views: 53

Machino

Registered User.
Local time
Yesterday, 22:04
Joined
Mar 26, 2019
Messages
13
Hi mike60smart
I removed the PO_ID's you just added because they didn't give the desired results. The Print Report button is supposed to show a printable list of PO's that are still outstanding or not completed. I added a set focus on the find record event procedure which I think is working correctly. Please take a look at it. The last oddity that I am encountering is that if you run the Print Report button and close the preview properly. When you select the Find Record button it displays the Print Preview again. It seems to be triggering the print preview again and again before showing the filled form. Curious. I am attaching the latest version of the DB. Thanks.
Machino
 

Attachments

  • Strathmoor Electric PO-3-28-2019.zip
    488.5 KB · Views: 41

mike60smart

Registered User.
Local time
Today, 03:04
Joined
Aug 6, 2017
Messages
1,904
Hi

I am a little puzzled as to how you can say show a list of PO's that are have a Status of outstanding or not completed.

The Only status you currently have is a Yes/No ??
 

Machino

Registered User.
Local time
Yesterday, 22:04
Joined
Mar 26, 2019
Messages
13
Hi mike60smart


I figured out the problem with the print preview. Everything is working fine for now. Thank you very very much for all of your assistance. Take care.
Best
Machino
 

Machino

Registered User.
Local time
Yesterday, 22:04
Joined
Mar 26, 2019
Messages
13
Hi Mike60smart
In the process of demonstrating how the database works I discovered a couple of anomalies. When you open any of the other tabs the fields do not initial as blank. Also, I found that all of the new entries made to the underlying tables through the corresponding forms (ie, Clients, Vendors, etc.) were not showing up in the main PO entry form. I added several vendors and staff in the demonstration but when I when to the dropdown lists on the main form they did not show. However, they were added to the tables. Any suggestions on how to fix these two issues? Thank you.
Machino


I am attaching the latest database.
 

Attachments

  • Strathmoor Electric PO-4-15-2019.accdb
    1.9 MB · Views: 46

Users who are viewing this thread

Top Bottom