Question & Answer
|Data||>How can I add a record simultaneously and
automatically to two tables in a One to One Relationship? I have
enforced referential integrity, so it can cascade update and cascade delete
automatically, but not add.
Relationships between tables only apply to existing records. There is not "cascade add" for records. You will have to put in some code. Here is an example of how it can work.
|Data||>My Zip Codes have only 3 or 4 digits to them,
especially in Connecticut and Massachusetts
During the data conversion,
the Zip Code field was probably set to Numeric instead of Text
|Locking||> Only one person can get in to the file,
and not two or more at the same time.
Here are the settings:
Question: How can I find how many fields there are in a table?
It is too much trouble to count one by one. There must be a faster way.
Go to Tools, Macro, Visual Basic Editor or Alt+F11
1. Make a field called ID and assign the numbers you want.
2. Copy the Table Create a new Table called TEMP with just the Structure Only, no data records
3. In TEMP add a field to the bottom of the list called IDAuto and make it AutoNumber
4. Go back to your table and sort by ID, then Copy All Records
5. Go to TEMP then Paste Append.
6. Verify that the data goes in the order you pasted and the IDAuto is in the same order as ID.
7. Go to Design mode and move the IDAuto field up to the top of the list of fields.
8. After verifying that TEMP is correct you can rename it to the name of your original data table.
How To Print A Single Record from a Microsoft Access Form into a Report
You may, at times, wish to only print the record that you are currently displaying in your Microsoft Access form. This can be done directly from the Form's File » Print Option and choosing Print Range » Selected Record(s).
However, forms are not really optimized to print out records and you may wish to present your data in a more user friendly approach.
Question » From a command button on my form, is it possible to print a report of only the current record?
Answer » Yes, You will need to define a WHERE clause in the DoCmd.OpenReport method
DoCmd.OpenReport reportname [, view][, filtername][, wherecondition]
DoCmd.OpenReport "rptEmployeeDetails", acViewPreview, , _
The first section DoCmd. OpenReport "rptEmployeeDetails",acViewPreview can be broken down as:
DoCmd.OpenReport is opening the report - "rptEmployeeDetails".
acViewPreview is opening the report in Print Preview mode.
The last section enclosed in the double quotes is the criteria which can be broken down as:
[lngEmpID] is the name on the unique fieldname of the record that identifies the record you want to print - it could be the Primary Key.
Forms!frmEmployeeDetails !lngEmpID is the place where the value of lngEmpID is to be found. In this case, On a form called 'frmEmployeeDetails' in a control called 'lngEmpID'
This method assumes that the record has already been selected on a form prior to printing. The Report name here is "rptEmployeeDetails".
Connect Access to Outlook contacts
Richard Ross send email from Access to Outlook
single or mass emails
How to overcome the 255 field limit in Microsoft Access