ACC2000: XSideBAR Control


Ok, it seems that everytime I want to write a decent tutorial on how to create some custom controls for access, I'm always short on time. I really dislike posting code without explaining my rationale for doing things.

In my opinion, getting code, and samples is good and useful, but really, does it assist others in understanding concepts? Most likely not.

In any event, I'm posting a sample of the sidebar control for you to play with and disect. I apologize as the code is not well written and has little comments to it. This is an earlier version, and not used in production.

This was an idea created from the original Windows LongHorn's sidebar app (now Vista)... I thought It was a really neat idea to have something usefull as that incorporated into an application with our own customize 'objects' for the business place and for fun of course.

The sidebar control requireds the following controls:

+ lblHeader - Access.Label
* the caption/title label for the sidebar
+ lblHeaderFx - Access.Label
* the caption/title dropshadow effect (if desired)
+ imgHeader - Access.Image
* the bitmap image for the sidebar's bacground (i tried using the form's picture property, but too much flickering when mouseovering
+ SidebarPaneCtl- Access.SubForm
* the subform control acting as a sidebar pane

The pane requires the following controls to be placed in a the form's header section:

+ lblHeader - Access.Label
* the caption/title label for the pane
+ imgHeader - Access.Image
* the bitmap image for the pane's header
+ imgHeaderIcon - Access.Image
* the bitmap image for the pane's icon (if desired)

As usual, constructive criticism is always accepted, and if you have questions or comments, please post with the exact same title in the forms forum so that others can benifit from the discussion, since there's not an Interface forum...

have fun and enjoy.

note: this post is the same found at

Post your answer or comment

comments powered by Disqus
Hello, I downloaded this sample database from the forum downloads section. I was wondering how I could use this form (Without login ect) for my full screen window and have all my forms on top of it. I like this due to it opening full screen and covering the taskbar, and access window frame. One problem is that the form is a pop up and I have to make all my forms pop ups to be on top and if I click off my pop up form it minimizes behind the ACC2000: XLogonXP Control form. Is there a way around all of this? Thanks!


I've received some good feedback to the XSideBAR "control" and I thought it would be a good idea to post a "Widget" for the XSideBar.

The attached sample demostrates how to use the DOMDocument object to download and parse XML feeds. And it also demostrates how to display weather information from

The only catch is that you'll have to register with's services to obtain a license key and partnet id as well as the SDK, which specifies business rules along with other goodies you may for a complete weather app.

The sample contains an XML sample file with other images used to display the current conditions. Unfortunately, this sample is made for the U.S., but i'm sure it shouldn't be too complicate to make it work with other regions.

As usual, if you have questions, post in the forms forum with the exact same title... have fun


Attached is a sample of a custom control for access. The XShortcutBAR is a control that mimics the menu bar the likes of MS Outlook 2003.

This could be used to replace the switchboard... This is a sample and it does not reflect the most up-to-date control, which consists of classes. And it's object oriented...

Please not that this is not a drag-n-drop solution, it's merely a starting point that you can build from

See screenshots below:

If you have any questions, post with the same title...



Attached is a sample of the Task Panel control or Explorer Bar as some (including me) refer to it as; this control is found in Windows XP.

As it is true in my other samples, this is not the most up to date and it's only to demostrate how to implement custom controls in Access. It does work as it should, but i have not revised the code for quite some time.

I would love to discuss in depth the rationale in creating the control but unfortunately my time is very limited.

In the past I've been asked as to why i don't upload the latest up-to-date samples (with some attitude i might add) and my answer is simple. Those are much more involved, they took time to develop as they contain custom classes, collections, and images and I'm unable to share it with the general public at this time, and for that I apologize; however, i will be doing some detailed tutorials on how to accomplish more roubust controls when the time allows it.

If anyone feels that i should not upload my samples, let me know and I shall stop.

The current sample is the container with the functions necessary to add, collapse, and expand the panes, as well as the ability to add icons to a pane's header. You will have to create the panes your self to meet your needs.

Sample Code:

	    '// instantiate class object
    Set XTaskPanel = New cXTaskPanel
    '// open object ref
    With XTaskPanel
        '// load ui
        .load UIForm
        '// add first pane and supply an icon
        .Add 1, "XPane", "Picture Tasks", CurrentProject.Path & "icon_.bmp", False
        '// add second and third with no icons and by default collpased
 	.Add 2, "XPane", "Task Pane 2", , True
        .Add 3, "XPane", "Task Pane 3", , True
        '// REDRAW 
        .Reload 1
    End With

As usual, if you have questions please post in the forums with the exact same title. Enjoy.


Attached is a sample of a logon interface. This control mimics the looks of the WindosXP logon screen. It is purely aesthetic.

This is NOT a security sample, it's just the interface. See screenshots below:

If you have questions, please post with the same title...


My ACC2000 form has some controls that on the OnCurrent event are conditionally made invisible. I also need to adjust the page margins programmatically. In ACC2000 this must be done using PRTMIP which necessitates loading the form in design view (DoCmd.OpenForm frmMyForm, acDesign) setting the margins, then returning to normal View (DoCmd.OpenForm frmMyForm, acNormal) to print it. When the form returns to normal view (1) the controls that had been made invisible reappear (ok, not a problem) and (2) further code to make them invisible returns 'the expression you entered refers to an object that is closed or doesnt exist'. What the blooming heck is going on?
(Notes: This happens whether the controls are referred to in (2) in the Me.Control syntax or Forms("MyForm").Controls("MyControl") syntax. The code for adjusting the margins I have adapted from )

I really would appreciate some help with this!

ACC2000: cXListBar

Posted on 03/17/08 09:26 PM Attachment (0 downloads)
Posted by Dom DXecutioner - Utter Access Ruler
Posts: 1144 - Loc: California

Forum: User Interface Design • Edit
• Reply
• Quote
• Quick Reply
• Print this post
• Bookmark Post
• Notify Moderator
• Email Post
• Top of page
The attached demo is an attemp at the visual style of the ListBar used in MS Outlook 2003/2007.

The idea was to display generic information such as data dictionaries with similarfields, i.e. Status, Categories, Priorities. In this case they all have some fields in common:

- recordID
- title
- description
- active
- recordCreateDate

The one field name that does change between data dictionary tables (in my case) is the ID fied, i.e., statusID, cateogoryID, priorityID.

This demo only supports this type of static structure, but you can expanded if you wish. This demo also uses conditional formatting to highlight the selected record.

It also exposes a [Selection] event, this is triggered on the [On Current] event of the listBar. The event will pass a filter with the primary key and the value, i.e., "statusID=1"; at that time, that was the only thing i could think of, well, first it was the primary key of the current record, but then i changed it... decisions, decisions

Also, the listBar displays the count of the records associated with it, you will; however, need to construct that in a query to display it correctly.

Anyway, take a look at the code and controls to really understand it... i wouldn't suggest using this in a real app, but i like the visual change, the most recent has icon support and other goodies.


I have tried something...but I get the error "Can't Assign to Array". Why do I get this?

Here is the code I've written - there are three arrays, one for each type of control (ImageFrame, ImagePath, ErrorMessage)

The form OnCurrent is meant to loop through the array until it reaches 6, but for some reason, I get the message above at "strImgFrame" and I assume the error is also at "strImgPath" and "strErrMsg".

Private Sub Form_Current()
Dim strImgFrame(1 To 6) As Variant
Dim strImgPath(1 To 6) As Variant
Dim strErrMsg(1 To 6) As Variant
Dim paramstring1 As String
Dim paramstring2 As String
Dim paramstring3 As String
Dim LoopCount As Integer
strImgFrame = Array("ImageFrame1", "ImageFrame2", "ImageFrame3", "ImageFrame4", "ImageFrame5", "ImageFrame6")
strImgPath = Array("ImagePath1", "ImagePath2", "ImagePath3", "ImagePath4", "ImagePath5", "ImagePath6")
strErrMsg = Array("ErrorMessage1", "ErrorMessage2", "ErrorMessage3", "ErrorMessage4", "ErrorMessage5", "ErrorMessage6")
For LoopCount = 1 To 6 Step 1
paramstring1 = strImgFrame(LoopCount)
paramstring2 = strImgPath(LoopCount)
paramstring3 = strErrMsg(LoopCount)
Call ShowHideImg(paramstring1, paramstring2, paramstring3)
End Sub

The function ShowHideImg is below:

Function ShowHideImg(ImgFrame As String, ImgPath As String, ErrMsg As String)
    Dim res As Boolean
    Dim FName As String
    Dim strImageFrame As String
    Dim strImagePath As String
    Dim strErrMsg As String
    strImageFrame = ImgFrame
    strImagePath = ImgPath
    strErrorMsg = ErrMsg
    Path = CurrentProject.Path
    On Error Resume Next
        strErrMsg.Visible = False
        If Not IsNull(Me!Photo) Then
            res = IsRelative(Me!Photo)
            FName = strImagePath
            If (res = True) Then
                FName = Path & "" & FName
            End If
            strImageFrame.Picture = FName
            showImageFrame (strImageFrame)
            Me.PaintPalette = strImageFrame.ObjectPalette
            If (strImageFrame.Picture  FName) Then
                hideImageFrame (strImageFrame)
                strErrorMessage.Caption = "Picture Not Found"
                strErrorMessage.Visible = True
            End If
            hideImageFrame (strImageFrame)
            strErrorMessage.Caption = "Please browse for an image"
            strErrorMessage.Visible = True
        End If
End Function

Please can someone help me, I'm getting annoyed with so many error messages!!

Quote: Originally Posted by vbaInet By the way, the nesting of subform controls within a tab or page in a tab doesn't really matter, you can reference the subform control because the names are unique. Yeah I SAW that and this thing was makin me an unbeliever. If I hit "add to reputation" do you at least get some kudos or something for helping me?

Quote: Originally Posted by mcdhappy80 Is it necessary for me to send You the database, because when I set Required property to No for fields in table, the Me.ControlName.Undo command works for form controls. If that works then no, you don't need to upload it.

Quote: With what function would I validate is the control empty, maybe with IsEmpty()? Not IsEmpty but you can use

	Dim blnError As Boolean
Dim strError As String

If Len(Me.YourControlName1Here & "") = 0 Then
    blnError = True
    strError = "YourControlName1Here" & vbCrLf 
End If

If Len(Me.YourControlName2Here & "") = 0 Then
    blnError = True
    strError = "YourControlName2Here" & vbCrLf 
End If

If Len(Me.YourControlName3Here & "") = 0 Then
    blnError = True
    strError = "YourControlName3Here" & vbCrLf 
End If

If Len(Me.YourControlName4Here & "") = 0 Then
    blnError = True
    strError = "YourControlName4Here" & vbCrLf 
End If

If blnError Then
   Cancel = True
   If Msgbox("You are missing required info for: " & vbCrLf & strError & vbCrLf & _
"Do you want to cancel this record?", vbExclamation, "Entry Error") = vbYes Then
   End If

that is just a sample. If you have checkboxes or other controls you might need a slightly different IF statement.

Your my hero!

It took me a while before I found the tag control, but now I get it. Thanks a lot!!

Quote: Originally Posted by liamfitz I'm having the same trouble myself. Any advice much appreciated. Here is what my VBA reference would be, if I just went down through the 'hierachy' using full-stops to get to the form with the value/control I want...
With frmNavigationLeft.frmNavigationTop.frmClients.sfrm Referrals.Variable/ControlName

i.e I have a Main Form ( frmClients ) holding a Subform ( sfrmReferrals ), these are both on a Navigation Form ( frmNavigationTop ), which itself is a 'sub' form of another Navigation Form ( frmNavigationLeft ). Please help if you can. Did you use the method I said to use in post #5 to get that path? I ask because it doesn't look like it based on what you have there. It doesn't use the names you would think in a normal subform situation and I haven't done it enough to have memorized the pattern. But each time I've used this method:
I have been able to get the correct path (but you do have to have the top level form open and then you select a control or something just to work your way down and then double click on the last portion to add it to, say the control source, just to get the path. You can then delete that control or delete the control source after you have copied it).

Thanks to ten years of Bliar and the stupid labour party kids now control our streets and adults musn't do anything to lay down the law to them untill after the event, do us a favour Brown and resign the whole bloody lot!

Over the last 3 or 4 sundays on the BBC, there has been a drama programme about how the Americans created a "secret" department called "Stormshield" and their job was to deflect hurricanes from the USA by creating a new weather system to act as the shield.

Obviously, it all went a bit wrong, and they deflected the hurricane from Miami to New York.
Making the new weather system off the west coast then created heavy rain over the southern states - Louisiana, Arkansas etc - when it then had to hit and deflect the hurricane.

Does the USA actually do this? (try to control the weather) or is it all fiction?

There was reference that the USA did it in Vietnam to upset the Viet Cong troop movements, don't know if that's true

There was a brilliant line in it from the US Government Department in charge of it. Stormshield were arguing that the heavy rain would be 6" and the Mississippi would rise and burst its banks and flood and kill people.
The government person said "we won't say it was man-made" - then Stormshield said the news people would soon suss it out, so the government person said "we always decide what does or does not get on the evening news, leave that to us"


I have two tables; one contains the results of a Survey with a count of the responses for each of the possible answers. For example, if I ask many people to pick a color from (1) red, (2) black, and (3) blue, (4) gray or (5) none. When the survey is over I have 40 1s, 13 2s, 6 3s, 55 4s, and 22 5s.
There are 7 questions and the greatest possible answer range is 7. For each question, I also have the total count of answers. This table is laid out with the Question number as fields and the counts as sequential data entries for a field's column. The total count ended in the 9th record.
The second table has the same layout except here the values are in percentages. All this is done in VBA and it works! (I am so poud!)
Now, I am attempting to display the data in a report with the basic format of: (1) a label with the question, (2) labels for the possible answers, (3) controls to hold the counts of the answers under each control and finally (4) controls under 3 above to hold the actual percentages that the responses for a particular answer represent.
Boy, if you've kept up with this, I already owe you one!
The VBA creates actual tables with these values from a module. Every time it runs, it deletes the previous values and repopulates the tables.
What I am looking for, is how to assign the value of a specific cell in the table, say the data in cell (3,4) to a specific control. I am not making much headway.
I created the first question, answer labels, and a few unbound controls that I named so that hopefully, I could change their name in a loop. [like txtCount_11 where I could concatenate the 11 with a str(column counter) & str(row counter).
This seems possible in a loop but I have no idea how to work with the table values in VBA. I was able to figure out how to create an array and populate the two tables in the module but this seems to be impossible.
I don't necessarily need code but some thoughtful conceptual responses would be most appreciated.
Ultimately I am looking for a way to assign txtCount_11 = table(col 2, row 3).
My thanks in advance to anyone who can help, Sorrells

I have a control which takes its value from the previous record by tagging it & setting the control to the tag. However I want the first control in any section to display 0 and not the last tagged value from the previous section so what code can I use which will say If this is the first record of this secion then value = 0 else value = tag etc
Happy YN

I am creating labels from two tables: one contains tenant names for apartments, the second is the occupant names for the same apartments. I used a query for the report. In the header I have the apartment number and the tenants names. In the Details section I have the occupant name field. This loops until there are no more occupants. Works fine. The problem is that I cannot control the size of the label. Optimum size seems to be 2 columns, 5 "labels" to a column. But when there are more than 2 occupants that label gets enlarged and throws the spacing off for the subsequent labels. My other option is to try to combine the appropriate tenants and occupants into one record. That allows me to control the label size. TIA for any ideas on any way to do this.


I have a simple car club membership database and I want to print a
roster with the names, adresses, phone numbers, email address,
and role of the members and their associate members (associate
member info is a PART of the member record in the table)

My problem is that if there IS NO associate member in a
particular member record, I still get BLANK LINES for each of
the associate member fields in the report. I am using
the CAN SHRINK property, but the blanks persist. I am
not using any labels for these text fields in the report.

The layout for the assocate member portion of the report
is as follows:

John C. Smith
Member at Large
123 Main st.
Baltimore, MD 21221

(301) 555-1234 (301) 555-5678 ext 4321

I am using CONTROLS to compress the NAME info and the
City, State, and postal code, as these are all separate
fields (fixed width) in the database and I don't want it to
appear as:

John C. Smith

Also, the "member role" field is a value list in the database.

Here is the CONTROL info I am using to eliminate the spaces
and accomodate missing info (such as City but no State)
Could these controls be causing the blank lines to appear?

for the NAME:

=[AssociateMemberFirst Name] & " " & [AssociateMemberMiddleInit] &
" "+[AssociateMemberLastName]

For the ADDRESS:

=Trim([AssociateMember City]+", " & [AssociateMember State]+" " & IIf(Len([AssociateMember ZipCode])=9,Left([AssociateMember ZipCode],5)+"-"+Right([AssociateMember ZipCode],4),[AssociateMember ZipCode]))

Phone number: Just using the field identifier and uses an input mask
if a phone number is entered into the DB: (000") 0"000-0000" ext "99999;9;_

AssociateMemberHomePhone AssociateMemberAlternatePhone

Case "Bottom Line"
Dim Begindate As Date
Dim EndDate As Date
Begindate = InputBox("Enter a Start Date ??/??/??", "Request Date", "")
EndDate = InputBox("Enter an Ending Date ??/??/??", "Request Date", "")

DoCmd.OpenReport "rptBottomLineQCmonthly", acViewPreview

The above case stmt gets 2 dates and then opens a report.
The control source on the report is an internal to the report parameter queries that uses the same to variable names.
How do I get the report to actually use them instead of prompting me for the info again.
Eventually I need to pull 4 separate reports all with differing queries but using the same 2 dates and would not want to enter them 4 times.

I have a subreport where some of the controls need to line up with those in the main report.

Does anyone have any hints and tips on this? The alignment tools don't work between reports and I assume that margins and borders etc are creating problems also. I can get within an nth of an inch but it's all guesswork and I wondered if there was a better way?



Ii have a MS RTF control on a form that displays fine. The control is linked to a memo field on a table that stores the RTF formating and the text. When I put a text box on a report linked to the field it shows the code and text not the formatted text. When I place a RTF control on the report and set the control source to the field I get property could not be set. Any Help


Does anyone know how to get this to work? In a control on a report I want to count the number of records between 10:00:00 and 11:00:00. The field name is [OutageTime]. I do not want to do this in the grouping and sorting because I intend to copy it and use it for every hour.

In the past I have used the following formula in a control to count other conditions as follows:


and this works fine!

Can someone modify this formula to get the results I'm looking for:


I am using XP and have an calculated control with an IIF function in it. I have Running Sum Over Group in the properties, but the sum will not run. It worked okay in Access 97, but won't work with this version. Ideas?

Hey, I have a text box on the detail line with control source as: =+1 the running sum is set to Over Group to increment

so if there are four records in the group it looks like:

..............................4 well I need it to show a one only for the first record of each group and zeroes to follow, like this:
..............................0 so is there a way to do this in the control source to say something like:
=1; unless >1 then display "0"

Thanks a lot.

Not finding an answer? Try a Google search.