A18.2 Call to Access Forms - LUPMISManual

Search
Go to content

Main menu:

Annexes 11-20 > A18. Programming

A18.2 Call to MS Access Form

Level of expertise required for this Chapter: Expert / Programmer; general Map Maker training

This approach allows links to forms only, but fast and easy. For more powerful Access operations see next chapter (Annex 18.3). It is not possible, to easily display graphics (pictures) files on forms in MS Access, except BMP, and therefore the need to use reports.

In general: Map Maker: Send variable (UPN) --> Access: Read variable and use as condition in Form

1. Security settings must allow access: Check that folder C:\LUPMIS\Permits including subfolders belongs to Trusted Locations: See Annex 1.1.12.

- - - -

2. Open (or create) an MS Access database (MDB file): In MS Access > MS Access tool button (circle at top left) > Open > Select folder and database (MDB) file > Open

- - - -

3. Main table (tbl_parcel) must have following fields. Create or import it using Access commands.

  • ‘UPN’ (text, field size:13)

  • ‘ID’ (autonumber, as primary key)

  • Additional fields are possible.


Make sure, that the field ‘UPN’ contains the same UPN numbers as the field ‘ID’ of the related DRA file. (See also Annex 10 on data standards).

- - - -

4. Create form (frm_parcel) using standard Access commands.

It must refer to the main table or query:
Forms: frm_parcel (just created) > right-mouse: Design View > top left: Right-mouse > Properties > Property sheet window: Data > Record source: tbl_parcel > Close it

- - - -

5. This form must have following on-load event procedure: Forms: frm_parcel > right-mouse: Design View > top left: Right-mouse > Properties > Property sheet window: Event > On Load: Select Event procedure > Click on ... > Add following lines:

Private Sub Form_Load()                                         
  Dim Identifier, stLinkCriteria as String                  
  Identifier = Command                                               
  stDocName = “frm_parcel”                                       
  stLinkCriteria = “[UPN]=’” & [Identifier] & “’”            
  DoCmd.OpenForm stDocName, , , stLinkCriteria
End Sub                                                                           


stLinkCriteria with variable from Map Maker is used as a ‘Where condition’.

- - - -

6. The database (MDB file) must have the startup function to point to the retrieving form (frm_parcel): With the database open: Access tool button > Access Options (at bottom) > Current database > Display form > frm_parcel > OK > Close it

In MS Access 2003:
Load database > Main menu > Tools > Startup > Startup window: Display Form/Page: Select frm_parcel > OK

- - - -


7. Map Maker must have following data link command line (see Chapter 6.9):
<access> “C:\LUPMIS\Permits\Area\Area_permits.mdb” /cmd “<label>”
where
Area is the name of the community

For example:
<access> “C:\LUPMIS\Permits\Kasoa\Kasoa_permits.mdb” /cmd “<label>”

  


 
Back to content | Back to main menu