The Linux Page

form

Display a line number in a table (i.e. subform of records)

I was ask by a customer to add line numbers to each entry in a table shown in an invoice.

The concept is pretty simple, but really, how do you do that properly in MS-Access?

Microsoft actually has a solution (see link below) and it comes down to writing a function that counts the number of items from that item's current position to the beginning of the table (i.e. going backward). It works, it is just really bad if you have very large invoices since it will tend to slow down as you start getting many items.

There is the function, we can see the counting in the do until near the end ...

Method 'item' of object 'forms' failed. MS-Access

As I was working on a project in MS-Access, I ran in a problem with this error which meant close to nothing, at least nothing to do with what I was working on.

The truth was that I had made changes in a parent form and the sub-form Load function would fail with that error. After a while I finally thought that the problem was probably with the fact that the parent was not compiling.

I used the Debug feature to compile everything and fixed the couple of errors I had to fix the problem. What the error in itself was is most certainly not relevant, although the two reasons for the mix up were ...

MS-Access sub-form auto-resize instead of staying put

Problem

Today I ran in a problem where I created a new form and the sub-form inside that form would auto-resize itself. Strangely enough, all my other forms also have a sub-form and that sub-form is not auto-resized... so what gives?!

I did not find anything about preventing an auto-resize of a sub-form. Found many pages on the net about how to write code to resize a form "manually". But that really did not help.

Solution

As I created that new form, I marked it as "Auto Resize" to No. This seems logical if you do not want a form to get resized. Think again! The ...

MS-Access query sort not working

Looked around on how to sort out a report properly as it was sorting on the wrong field (actually at first it did not even look like it was sorted at all, but I did not notice that other field was indeed sorted!)

The sort in a Query Report form (opposed to just an SQL query) is defined by the Group & Sort feature and not the SQL results. Actually, you most certainly don't need it in the SQL because otherwise you'll be sorting twice.

It took me a while, but I'm glad I found the solution. All the documentation I searched only talked about the wrong methods: use the Query sort ...

MS-Access and Focus handling

MS-Access can be programmed with VBA which is neat. I do that a lot because the default forms do not allow you to strongly verify the data validity or even better: prevent you from editing certain record because they are too old, you don't have permissions, it was already archived in some way (i.e. invoice paid), etc.

However, I often encounter problems with the focus. The main thing I do to make it as safe as possible is show or hide buttons. If you cannot activate function A, then there is no point in having a button for function A. Instead, we should hide the function A button when we ...

Check whether a form is open in MS-Access

MS-Access has forms, but no real means to know whether a form exists. It looks like you could go through the list of forms (Forms.item(i)) but I'm not too sure that would work in all circumstances.

Instead, I used code I found on another site which runs a system command to determine whether a form is currently attached to a window (has a state other than zero.)

The code looks like this:

IsLoaded = False
If SysCmd(acSysCmdGetObjectState, acForm, strFormName) <> 0 Then
    If Forms(strFormName).CurrentView <> 0 Then
        IsLoaded = True
    End If
End If

The first ...

jQuery and functions/variables between a parent and an IFRAME

In the last few days I have been working on a small project to get a really nice form for one of my sites. The form uses a lot of JavaScript for all sorts of fancy things (such as check user input to make sure we don't accept total crap such as an empty entry or just "1" as a credit card number.)

The information finds itself in an IFRAME, which was the easiest way to get the time to load at decent speed and  to better manage the form in a separate area and not the main landing page. This will make it easier to maintain the landing page itself.

however, that created ...

Drupal blocks all disappeared!

Today I had an interesting experience... all of a sudden, all the blocks of a given theme disappeared.

It has been working just fine for months, so I really wasn't sure what the heck it could be.

The fact was that the theme was called the same as the module (as I work for a given client, I tend to do that...)

At some point, I must have added a function with a specific name and that would influence the theme. The result being blocks going bye bye!

I checked and the block content is computed just fine, the problem is the theme('block', $block) call. Although the ...

Drupal paths that won't work!

As I created a new site to list all of my accounts on the Internet, I thought the folder where those accounts appear should be called profiles. But somehow autopath did not generate the URL Alias as expected.

https://www.alexiswilke.me/profiles/

I tried several times and each time it returned an empty alias. Then I tried adding the alias by hand and that was accepted by Drupal, but when I then tried to go to that page it failed with an Apache error which at first I found odd. Then I recalled that there was a folder named profiles in the top directory of Drupal. The Drupal code (from the

MS-Access hangs when setting a recordset

Today I experienced a hard lock-up with MS-Access as I was in a form typing a new query.

The new query data is checked first, if valid, then the query is processed and ends in a SELECT SQL order which I save in the Form with a simple OpenRecordset call as in:

sql = "SELECT stuff FROM thing WHERE foo LIKE 'begin*'"
Set CUSTOMER_LIST.Form.Recordset = CurrentDb.OpenRecordset(sql)

That used to work just fine in older versions of MS-Access, but we now use MS-Access 2007.

The hanging happens on the 2nd line, when the Set occurs. Note that it generally happens the second

Syndicate content Syndicate content

SMS From Me Logo

SMS From Me

To automatically start one on one conversations with your online leads.

     

   

Terms of Site Index

Find the page/content you are looking for with our index.

  • X11
  • documentation
  • lock

    A lock is used to limit the use of shared resources in different ways. When only using the data in read mode, the lock will prevent modifications, but any number of threads and processes can access the data. When in write mode, then only the owner can access the data.

  • proxy

    In networking, a proxy is an intermediate network connection used to hide a user or computer. Most large companies use multiple proxies to hide all of their different intranets. Technically, when using a proxy you actually send all your network data to that other computer and that computer is in charge of sending that data outside your organization. Very large companies generally have multiple levels of proxies.

  • remote