Note that there are some explanatory texts on larger screens.

plurals
  1. POAdd record to table, and edit records in 2 separate tables
    text
    copied!<p>Hi there I'm making an access database, and I can't figure out how to do one particular thing.</p> <p>I've got a form with two text boxes: MovieID and CustomerID. I also have three separate tables: MovieList, CustomerInfo and HireHistory. What I need is so that when I enter a MovieID and CustomerID into the given boxes then press my button HireButton, it edits that specific MovieID's LastHireDate to Today(), edits that specific CustomerID's LastHireDate to Today(), and then in my HireForm (which has the CustomerID's in the first row) it adds a new record below the CustomerID in the form of: <code>MovieID " on " Today()</code></p> <p>Also, I need to make it so that it checks that MovieID's genre and if it's R16 or R18, then it checks whether the customer is older than 16 or 18 today, and if not then it comes up with an error box. I know how to do the checking whether they are older than 16 or 18, but not the error box.</p> <p>I know that's a lot of text, so I'll just write what's in my brain (how I see the code should be) so it will be easier to see what I want to do.</p> <pre><code>IF MovieID.Rating = 'R16' OR 'R18' THEN IF CustomerID.[Date(Year(DOB)+16,Month(DOB),(Day(DOB))] &gt; Today() THEN DISPLAY Msgbox = "Sorry, too young" ELSE SET CustomerID.LastHireDate = Today() SET MovieID.LastHireDate = Today() ADDRECORD in HireHistory for that CustomerID to (MovieID &amp; " on " &amp; Today()) ELSE SET CustomerID.LastHireDate = Today() SET MovieID.LastHireDate = Today() ADDRECORD in HireHistory for that CustomerID to (MovieID &amp; " on " &amp; Today()) </code></pre> <p>Does that explain it a bit better? Thanks in advance for your help! :)</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload