Full Version: My UI
UtterAccess Discussion Forums > Microsoft® Access > Interface Design
JonoB
Hi all,

After some inspiration from other posts on these forums, please see the latest version of my ui.

There are still a couple of loose ends that I need to tidy up, but its pretty much all there.

Would love to hear your comments, both good and bad.

Edit : Apologies for the blurring on the images...lots of confidential stuff!

Edited by: JonoB on Thu Dec 15 8:54:41 EST 2005.
JonoB
I should probably add that there is loads and loads of functionality that you can't really pick up from the screens that I have shown you. Some of this includes:

1. Ability to print reports directly to PDF and store the attachment links in the database

2. Lots of intergration with Excel, Word and Outlook. For example:
-We run about 10 Excel financial models every day, and the variables for each model are dumped into the access database, which can be recalled and remodelled at any time from Excel.
-Sending data to Word to auto generate various letters.
-Saving of Outlook emails directly to the database

3. Ability to send emails (with attachments) to various contacts in the database, whether they are internal employees or external contacts.

4. Lots and lots of other stuff!

Shout if you have questions.
trip
Well i for one really like it, especially your treeview admin seciton it's great on it's own.

Congrats mate, job well done.
mlowell
Good job Jono..looks very clean and tidy, love the tree view type navigation (wish I could that, may have to sit down one day and work it out).

Keep up the good work.

ML
perrymans
WTF? I can't believe you aren't receiving more praise because this thing is awesome!!!

Your strongest point? Management. User Management and that Treeview manager is amazing! You said you gleemed most of this from UA, did that management page come from here too? You should post that to the code archive because it would really open the treeview world to some of the newer users.

I should probably set up something like that too, but I hard code all of mine because they are dynamically filled (used for record navigation, not site navigation, though that would probably be a smart thing to do).

One thing I don't do is user login management. What schema/ model did you select for this? Most of the DB's I do are for individuals who don't want/ need the passwords.

I see you are calling Google maps, is that slow to load?

I am going to copy your company form, I have drifted from tabs for some reason, but really need to get back to them. Those are buttons that display a subform though right? Not an actual tab control? If it is a tab control, how did you get the tabs to change? (or are the buttons simply placed over the tabs?).

A listbox for associated files! Why haven't I thought of that? I have been using a continuous form, but no more thanks to you. Are the attachments reading the file attributes (like Date) or is that the date the attachment was added?

How do you print to PDF? Hard coding, add-on, .dll, or print driver such a CutePDF?

Finally, a critique. Obviously you are not showing every form, but the last two in the presentation seem to be a departure from the rest by using a large amount of light blue.

I have seen a lot of pretty and fancy UI here, but this one has been truly inspirational.

Now don't skimp onanswering the questions!

Thanks. Sean.
RNeal
Downloaded it and think your work is beautiful. On the "company and contacts" form, I don't see info about the company as the name implies, wondering if a better name this form might receive. Other tabs indicate that there is more info available than what "company and contacts" implies. One form used the word "contact" and "person" (radio button). I would make that consistent (both "contacts"). Not much that can be said critically, it would be getting into personal tastes. Truly professional work! Thanks for sharing and Merry Christmas.
JonoB
Well, thanks for the praise, much appreciated. Some answers to your questions:

QUOTE
Your strongest point? Management. User Management and that Treeview manager is amazing! You said you gleemed most of this from UA, did that management page come from here too? You should post that to the code archive because it would really open the treeview world to some of the newer users.

Well, the treeview had me pretty much daunted when I started out with it. I found bits and pieces of code all over the net, but none of them really seemed that intuitive to me. So I got my hands dirty and figured out a simple quick way to work with the treeivew on my own. Let me know if you want table and code structure.



QUOTE
One thing I don't do is user login management. What schema/ model did you select for this? Most of the DB's I do are for individuals who don't want/ need the passwords.

For this part, I just use windows network login, which you can get from an api call. I used the code found at http://www.mvps.org/access/api/api0008.htm. I dont use passwords, because the windows password will be stronger than anything I can devise in access! Note that the environ("Username") method is easy to spoof (simple as using a dos promt!). I assign permissions based on the username, and what levels of the tree they can see and actions they can perform. Each record that is added or amended to the database also gets tagged with the username, so we know exactly who has added/amended what.

QUOTE
I see you are calling Google maps, is that slow to load?

Nope, not google maps. We have a need to pass maps between various applications. For example, we populate a word document and an excel spreadsheet with a map. The best way that I have found to do this, is allow the user to create a map in Microssoft MapPoint, save it as a jpeg and then attach that jpeg file to the database. That way, at any time I need that map, I just need to lookup the tblsite.mappath field value where tblsite.siteid = x. I do that with ado recordsets in excel and word. I didnt really show it on the userform where you saw the maps, but if you click on the small map, a new popup form opens with a full screen map. You will also note that I have linked to Streetmap (www.streetmap.co.uk), which I call like this:
Me.cmdWeb.HyperlinkAddress = "http://www.streetmap.co.uk/streetmap.dll?postcode2map?code=" & Me.txtPostcode & "&title=" & Me.txtSiteName


QUOTE
I am going to copy your company form, I have drifted from tabs for some reason, but really need to get back to them. Those are buttons that display a subform though right? Not an actual tab control? If it is a tab control, how did you get the tabs to change? (or are the buttons simply placed over the tabs?).

Yeah, I am still not convinced by this form. It is a tabbed form with subforms on each tab, using Access 2003. I've tryied to stick away from tabs and multiple subforms, mainly due to speed. And this form doesnt *really* fit in from a ui point of view. But it isnt used that much, so left it on my to do list.#


QUOTE
A listbox for associated files! Why haven't I thought of that? I have been using a continuous form, but no more thanks to you. Are the attachments reading the file attributes (like Date) or is that the date the attachment was added?

No, the date field shows the date that the file was attached. Although it wouldnt be too difficult to get the file attributes, there wouldnt be much use in that for our circumstances.

QUOTE
How do you print to PDF? Hard coding, add-on, .dll, or print driver such a CutePDF?

This bugged me for so long I cant tell you. I tried so many methods and drivers that it was driving me crazy. Most of all I wanted something free! I was just about to try the Adobe version ($$), until I stumbled on this http://sourceforge.net/projects/pdfcreator/ Woot! A pdf creator with a com interface that you can control from vba!! After quite a bit of trial and error, I got this working 100% in all my MS applications (Access, Word, Excel).With access, for example, if I want to email a report out, I can print the report to pdf, attach it to an email and then send it to pre-specified people in my database and keep a record of all of that. All from one simple form. Let me know if you want some vba code to go with this.

QUOTE
Finally, a critique. Obviously you are not showing every form, but the last two in the presentation seem to be a departure from the rest by using a large amount of light blue.

Couldnt agree with you more, this is on my to-do list! A relic from a previous version of the database.

QUOTE
Downloaded it and think your work is beautiful. On the "company and contacts" form, I don't see info about the company as the name implies, wondering if a better name this form might receive. Other tabs indicate that there is more info available than what "company and contacts" implies. One form used the word "contact" and "person" (radio button). I would make that consistent (both "contacts"). Not much that can be said critically, it would be getting into personal tastes. Truly professional work! Thanks for sharing and Merry Christmas.

Thanks for the kind words. To be honest, there isnt that much info on the company, other than whats found on the address tab. But yeah, this part of the database hasnt really sat well with me. Suffice it to say that certain other people in the company want certain things reflected in a way that I dont agree with either; and I am tired of arguing to the contrary!
perrymans
I think we would all like to see any samples you could provide, but I am most interested in the treeview and print to pdf.

With pdf, I am wondering how you are controlling it? Is it something in PDFCreator? Or something in the fact that it is set up as a print driver, so you just specify which print driver to use?

As for PDFCreator, I used to use this until I found CutePDF (http://www.cutepdf.com/Products/CutePDF/writer.asp). It is from a company, but it is free. The main difference is it goes straight to the save dialog, rather than stopping at the PDFCreator window first. Seems silly, but it saves a lot of time when you are converting a bunch of files to pdf using the print driver.

Below is the foundation I used to create Treeviews. Apparently, there used to be a wizard for treeviews in Access 9, but it was removed since. It seems that this is still the prefered method to populate the tree and looks easy to manipulate with variables (which I have not done yet). This particular code is from Helen Feddema's book Access Application Development... Enjoy. Sean.

CODE
Function tvwBooks_Fill()
'Created by Helen Feddema 2-10-2002
'Last modified 8-28-2003

'============================================================
'Modified from a procedure generated by the Treeview Control Wizard
'
'PURPOSE: Fill the ActiveX Treeview Control 'tvwBooks'
'ACCEPTS: Nothing
'RETURNS: Nothing
'CALLED FROM: Form Load event
'============================================================

On Error GoTo ErrorHandler

   Dim strMessage As String
   Dim dbs As DAO.Database
   Dim rst As DAO.Recordset
   Dim intVBMsg As Integer
   Dim strQuery1 As String
   Dim strQuery2 As String
   Dim nod As Object
   Dim strNode1Text As String
   Dim strNode2Text As String
   Dim strVisibleText1 As String
   Dim strVisibleText2 As String
  
   Set dbs = CurrentDb()
   strQuery1 = "qryEBookAuthors"
   strQuery2 = "qryEBooksByAuthor"
  
   With Me![tvwBooks]
      'Fill Level 1
      Set rst = dbs.OpenRecordset(strQuery1, dbOpenForwardOnly)

      'Add a node object for each record in the "qryEBookAuthors" table/query.
      'For parent nodes, the Key property is based on the the level of the tree
      'in which the node exists and the Link Master field(s) you selected when
      'linking levels in the wizard.  For child nodes, the Relative property
      'is based on the level of the tree in which the Parent node exists and
      'the Link Child field(s) you selected when linking levels in the wizard.

      Do Until rst.EOF
         Debug.Print "Adding Level 1 item: " & rst![AuthorID]
         strNode1Text = StrConv("Level1 - " & rst![AuthorID], _
            vbLowerCase)
         Debug.Print "Node 1 text: " & strNode1Text
         strVisibleText1 = rst![LastNameFirst]
         Debug.Print "Level 1 visible text: " & strVisibleText1
         Set nod = .Nodes.Add(Key:=strNode1Text, _
            Text:=strVisibleText1)
         nod.Expanded = True
         rst.MoveNext
      Loop
      rst.Close
      
      'Fill Level 2
      Set rst = dbs.OpenRecordset(strQuery2, dbOpenForwardOnly)

      'Add a node object for each record in the "qryEBooksByAuthor"
      'table/query. For parent nodes, the Key property is based on the
      'level of the tree in which the node exists and the Link Master
      'field(s) you selected when linking levels in the wizard.  For child
      'nodes, the Relative property is based on the level of the tree in
      'which the Parent node exists and the Link Child field(s) you selected
      'when linking levels in the wizard.

      Do Until rst.EOF
         Debug.Print "Adding Level 2 item: " & rst![Title]
         strNode1Text = StrConv("Level1 - " & rst![AuthorID], vbLowerCase)
         Debug.Print "Node 1 text: "; strNode1Text
         strNode2Text = StrConv("Level2 - " & rst![AuthorID] & " - " _
            & rst![Title], vbLowerCase)
         Debug.Print "Node 2 text: " & strNode2Text
         strVisibleText2 = rst![Title] & rst![BeenRead]
         Debug.Print "Visible text: " & strVisibleText2
         .Nodes.Add relative:=strNode1Text, _
            relationship:=tvwChild, _
            Key:=strNode2Text, _
            Text:=strVisibleText2
         rst.MoveNext
      Loop
      rst.Close
      
   End With
   dbs.Close

ErrorHandlerExit:
   Exit Function

ErrorHandler:
   Select Case Err.Number
      Case 35601
         'Element not found
         strMessage = "Possible Causes: You selected a table/query" _
            & " for a child level which does not correspond to a value" _
            & " from its parent level."
         intVBMsg = MsgBox(Error$ & strMessage, vbOKOnly + _
            vbExclamation, "Run-time Error: " & Err.Number)
      Case 35602
         'Key is not unique in collection
         strMessage = "Possible Causes: You selected a non-unique" _
            & " field to link levels."
         intVBMsg = MsgBox(Error$ & strMessage, vbOKOnly + _
            vbExclamation, "Run-time Error: " & Err.Number)
      Case Else
         intVBMsg = MsgBox(Error$ & "@@", vbOKOnly + _
            vbExclamation, "Run-time Error: " & Err.Number)
   End Select
   Resume ErrorHandlerExit

End Function


Private Sub tvwBooks_NodeClick(ByVal Node As Object)
'Created by Helen Feddema 2-10-2002
'Last modified 8-30-2003

On Error GoTo ErrorHandler

   Dim frm As Access.Form
   Dim strNodeText As String
   Dim strTitlePlus As String
  
   Set frm = Me![subBookInformation].Form
  
   Debug.Print "Node key: " & Node.Key
   If Left(Node.Key, 6) = "level2" Then
      If Right(Node.Text, 1) = Chr$(215) Or _
         Right(Node.Text, 1) = Chr$(247) Then
         strNodeText = Left(Node.Text, Len(Node.Text) - 1)
      Else
         strNodeText = Node.Text
      End If
      
      Debug.Print "Node text: " & strNodeText
      strTitlePlus = Mid(Node.Key, 10)
      Debug.Print "Title plus: " & strTitlePlus
      Me![txtSelectedBook].Value = strTitlePlus
      frm.Requery
      frm![txtSeriesNumber].Enabled = frm![chkSeries].Value
      frm![cboSeriesName].Enabled = frm![chkSeries].Value
      frm.Visible = True
   Else
      frm.Visible = False
   End If
      
ErrorHandlerExit:
   Exit Sub

ErrorHandler:
   MsgBox "Error No: " & Err.Number & "; Description: " & Err.Description
   Resume ErrorHandlerExit

End Sub
JonoB
QUOTE
With pdf, I am wondering how you are controlling it? Is it something in PDFCreator? Or something in the fact that it is set up as a print driver, so you just specify which print driver to use?

As for PDFCreator, I used to use this until I found CutePDF (http://www.cutepdf.com/Products/CutePDF/writer.asp). It is from a company, but it is free. The main difference is it goes straight to the save dialog, rather than stopping at the PDFCreator window first. Seems silly, but it saves a lot of time when you are converting a bunch of files to pdf using the print driver.


Yup, I tried cutepdf as well, and managed to almost fully automate it. With pdfcreator, it is FULLY autmated, no save dialogues, nothing! You can specify the pdf file name and directory to save it to, and whether you want to view it after saving....

This is the code that I used:

Option Compare Database
Option Explicit

Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)

Private Const maxTime = 10 ' in seconds
Private Const sleepTime = 250 ' in milliseconds

Public Function PrintPDF(ByVal rptName As String, ByVal sFilterCriteria As String, Optional sAutoSaveDirectory As String, Optional sAutoSaveFileName As String) As Boolean

'initialise
On Error GoTo err_Error
Dim clsPDF As PDFCreator.clsPDFCreator 'Initialise the PDF class
Dim strDefaultPrinter As String
Dim strOutputFileName As String
Dim strSaveDirectory As String
Dim i As Long

'set the success variable to true here but it will be set to
'false if the function fails at any point
PrintPDF = True

Set clsPDF = New clsPDFCreator

With clsPDF
.cStart "/NoProcessingAtStartup"
.cOption("UseAutosave") = 1 '1 = True, 0 = False

If sAutoSaveDirectory = "" Then
.cOption("UseAutosaveDirectory") = 0
Else
.cOption("UseAutosaveDirectory") = 1
.cOption("AutosaveDirectory") = sAutoSaveDirectory
End If

If sAutoSaveFileName = "" Then
.cOption("AutosaveFileName") = rptName
Else
.cOption("AutosaveFileName") = sAutoSaveFileName
End If

.cOption("AutosaveFormat") = 0 '0 = PDF
'strDefaultPrinter = .cDefaultPrinter
'.cDefaultPrinter = "PDFCreator"
.cClearCache
Sleep 1
DoCmd.OpenReport rptName, acViewNormal, , sFilterCriteria
.cPrinterStop = False
End With

i = 0

Do While (clsPDF.cOutputFilename = "") And (i < (maxTime * 1000 / sleepTime))
i = i + 1
Sleep 500
Loop

strOutputFileName = clsPDF.cOutputFilename

With clsPDF
'.cDefaultPrinter = strDefaultPrinter
'Sleep 200
.cClose
End With

If strOutputFileName = "" Then
' MsgBox "Creating pdf file." & vbCrLf & vbCrLf & _
' "An error has occured: Time is up!", vbExclamation + vbSystemModal
PrintPDF = False
Call HandleError("Report " & sAutoSaveFileName & " did not print", "modPDFPrinter_PrintPDF")
End If

'error handler and exit
err_Exit:
Set clsPDF = Nothing
Exit Function
err_Error:
PrintPDF = False
MsgBox Err.Description
Call HandleError(Err.Description, "modPDFPrinter_PrintPDF")
Resume err_Exit
Resume

End Function
Virtus
I too used PDFcreator for turning reports into PDF's. I recently came across a ReportToPDF mdb that is much easier to use and distribute.

http://www.lebans.com/reporttopdf.htm
perrymans
I think I'll take you up on your offer for the code and table structure!

I have a new need to fill a tree manually like this, rather than dynamically from records.

Thanks. Sean.
don1
Yes, Lebans has done a great job with his ReportToPdf converter. I use it in my mdb's with success...
Midnight
Jono
Great stuff!
Good visuals and well -structured.
Love the Treeview and wish I could do one with images like yours.

A lot of hard work has gone into this db - and it shows!!
:-)
Paul
bflemi3
Jono,

If you're still checking this post is it possible to email a copy of your DB? I am trying do something similar to what your DB seems to do and am having a [censored] of a time implementing it. I have not been able to find any other examples that match so closely.

email: bbfleming3@yahoo.com

Thanks,
-B
rjAccDB
Jono,

Very nice!, realy awesome.

I always admire the "TreeView" thing.

If you could share a demo db here in the code archive that benefit members.

my admiration,
rj
perrymans
I still want that Treeview admin feature!

Why you holding out homie?

Sean.
Richyg01
I think it looks great, I would love to get my hands on the code for the treeview, is there any way you can make a dummy database with the tree function built in for us to look at.

Chears
Dom DXecutioner
If i may add my 2 cents (as the sayin' goes)...

Addin' an admin feature to a treeview menu should not be code embedded into an object's piece of code, only for verification pursposes... The admin (or security, if you will) should be an object/code of it's own... The pseudo code below would illustrate my point... hopefully sad.gif

CODE
[color="green"]'// instantiate the Custom Database Security class object[/color]

Public CDBSecurity As New cCDBSecurity



[color="green"]'// this code here assumes that you use a table to fill the treeview, and

'// that the table holds a Security Role ID field, which identifies who sees what... [/color]

Function FillTreeviewRecursively() As Boolean

For Each Record In TheTreeviewRecordSet

      If Not Field("SecurityRoleID") = AdminID Then

           AddTreeviewNodeItem

      Else

           If CDBSecurity.UserRoleID = AdminID Then

                 AddTreeviewNodeItem

           Else

                 IgnoreItemAndDoSomethingElse

           End If

      End If

Next Record

End Function





[color="green"]'// this code here assumes that you use a table to fill the explorer bar, and

'// that the table holds a Security Role ID field, which identifies who sees what... [/color]

Function FillExplorerBar() As Boolean

For Each Record In TheExplorerBarRecorSet

      If Not Field("SecurityRoleID") = AdminID Then

           AddExplorerBarItem

      Else

           If CDBSecurity.UserRoleID = AdminID Then

                 AddExplorerBarItem

           Else

                 IgnoreItemAndDoSomethingElse

           End If

      End If

Next Record

End Function




Edited by: Xyon-X on Tue May 8 22:59:55 EDT 2007.
which1
I have tried this code but I can't seem to get it to work. clsPDF.cOutputFilename is always empty and my app always hangs. I don't want to depend on other dll's or ocx's. Please help
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.