Tuesday, November 22, 2016

using wildcards in IIF statements

IIf([PlanType] Like "*Open*","Yes","No")

will be true for BN Open. BE Open-J

Tuesday, November 15, 2016

You may have chosen fields from record sources which the wizard can't connect

To correct this error, I simply created the query manually rather than using the wizard (wizard is not that smart sometimes). Of course make sure all your relationships are correct first.
 To create a query manually:

Create > Query Design

To see all relationships

I was recently working on a project and I had defined several relationships, between tables and between queries. I decided to rename the queries and when I went back to the relationships window to see if the relationships had been updated with the new query names, I could no longer see the query relationships - I could only see the table relationships. The queries were working fine but I was worried because I couldnt see the query relationships. Googling, I found the answer I was looking for:
go to database tools > relationships > all relationships

Thursday, November 10, 2016

Leszynski_Reddick Naming Convention

Create an AutoExec macro that runs when the DB is opened

From:


Create an AutoExec macro:
If you have already created a macro that contains the actions that you want to occur when the database starts, just rename the macro AutoExec, and it will run the next time that you open the database. Otherwise, follow these steps to create a macro:
  1. On the Create tab, in the Other group, click Macro. If this command is unavailable, click the arrow beneath either the Module or the Class Module button, and then click Macro.
  2. In the Macro Builder, in the first empty Action cell, select the action that you want to perform. If applicable, under Action Arguments, type the appropriate values in the argument boxes.
    If you cannot find the action you want, on the Design tab, in the Show/Hide group, make sure Show All Actions is selected. This expands the list of actions that you can use, but the list will include some actions that will only run if the database is granted trusted status. For more information, see the articles Decide whether to trust a database or How database objects behave when trusted and untrusted.
  3. Repeat step 2 for each additional action you want to occur.
  4. Click Save, and in the Save As dialog box, type AutoExec.
  5. Click OK and then close the Macro Builder. The new macro will run the next time that you open the database.
For more information about how to create macros, see the article Create a macro.
NOTE: 

Set the default form that appears when you open a database


This procedure assumes that you have already created the form that you want to display.
  1. Click the File, and then click Access Options.
  2. Click Current Database, and then in the Display Form list, select the form that you want to display when the database starts.
  3. Click OK, and then close and reopen the database to display the startup form.
NOTE: 
  • To bypass this option and other startup options, hold down the SHIFT key while you start the database. For more information, see the article Bypass startup options when you open a database.
  • By attaching macros or VBA code to the startup form's OnOpen or OnLoad event, you can specify more actions that occur every time that the database starts. For more information about how to create macros, see the article Create a macro.