Passa al contingut principal

Entrades

S'estan mostrant les entrades d'aquesta data: 2016

How to manage data in forms using only VBA. And why. How to use System Windows and stored files.

Introduction Hi all! Today's subject is about how to use a form to manage data using only VBA. As you know, manage forms with data in Access is very easy, practical, and may be done from the first minute. When you build a data source, a table or a query, you may create a form linked to them. This means that Access will do all the tasks related to manage the data, and when the form will be opened it will show those data automatically. This is very useful, especially when the user is a beginner, or just when neither the time nor security are really important. I will try to explain myself better. When we use the wizard to build a form, it fills automatically the RowSource property for the form, and the same for each field. As I said, this is useful, but may have some problems: When there are a big amount of records (more than 250.000) and/or a big amount of fields, the load process may be a little bit slow, and also if the form shows a large set of records or it has to sel

Use of listboxes as a data summary instead data forms

Hi all This post is an extension of the previous post ( how to develop a carousel ). Here I will show how to manage a summary form linked to a detail one, in order to show data and detail them. I want to clarify that this is not "the way" to work with access, this is "a way". This is the way I use. After been developing Access applications, I've found this is a good solution, and I use it almost always. I will improve the previous example, the used cars seller adding a new form. The new form has a listbox and some buttons (add, delete, duplicate and modify) to perform those operations. All those operations are solved using VBA, as you may see. The new form is named Main. You may see in the next screenshot I've added new records. Once the form is loaded, the data are stored in the listbox using the Form_load event. The objects are named as follows: Button Add is named cmdAdd Button Duplicate is named cmdDuplicate Button Delete is named cmdD

How to develop a carousel

Introduction Hi all! This week's post is a mix of part of the previous made practical. I will make grow the present example in following posts. We have seen how to organise an application, how to manage attached files, and how to work with options. This week we will join some of those characteristics to develop a Carousel. This is an example I've made some years ago to help a user with a carousel for used cars. It's made thinking on the spanish market, and I've used the plate number usual in Spain, that is, a number between 0000 and 9999 and three characters B-Z (avoiding the vowels). It's made with Access 2003. What is a carousel and when may be useful? A carousel is a form to show images, pictures, and when is loaded shows, automatically, a picture each time. In this case is each 5 seconds (5000 milliseconds). This may be useful, for example, in a business where you want to show photos of your goods to your customers: used cars, real estate..., that can

Visits to the blog on February 16

Hi all This is my first post for today. The second is in the oven and will be posted soon. Well, it's less than a month I've decided to publish some posts about programming and databases. My choice was MS Access because this is the tool I use since 1993, when I discovered the 2.0 version. Of course in the future will be posts of other languages, but by now, it's my developing tool. I would like to talk about why I use Access to develop, and why this may seem a hobbysts tool but is so far of this definition, but it will be in another post, I don't want to bore anyone. I started to publish last feb 10, and this last month I've been following the visits to the blog all days. This is the third time I start a blog, and by now, it's the most visited. I would like to share with you a graph of the visits. I'm proud of those data, and I hope to increase those numbers. I have a list of more than 20 posts ready to finish, and this list grows day by day, becaus

How to manage attached files with access. Options.

Hi all This week's post is about how to manage attached files with MS-Access and VBA. Introduction Sometimes is useful and/or necessary to store attached files in our applications. Let's see some examples: A used car seller may have a database with all the vehicles on sale, and may need to have photos of the cars, to show them to the potential customers before seeing the cars. And also may want to store digitalized the papers of the car. A real state business, has a file with each property, and may want to show the photos to the potential customers before visit, to restrict the number of properties to visit. And not only the photos, but also legal papers about the property. A doctor, may want to save information about their patients, but sometimes this information is not suitable to be stored in a record, for example a bone scan or the results of some tests, but is useful to attach to the patient file to find it more easily. A farmer may need to store data about the

How to export data from access to a text file

Introduction Hi all Today's post is about a set of functions to export data from Access to text files. I wrote the next functions years ago, when working on a big project and I had to export some of my data to another system, by text files, regularly. I needed something easy for the users, and transparent. I will explain what I did, and how. At the end of this post you will find a link to download the example of code. Feel free to modify it. Sometimes it happens that we need to export data. Of course, almost always we may write to another database. As I said before, I wrote this code to cover a need. This is a brief: I've been working for a company who mades canned fish. They had their ERP software, made by a external firm, and mantained across more than 20 years. When I entered, I had to write a software to control the production process and traceability. Of course, my processes (my software) was a subset of all the other software, and they had to communicate th

How to organise an access application

Access is a powerful tool not only to manage data, but also to develop professional software. Due to its powerful structure, it is possible to work with it in some diffent ways, while the application grows up. For the rookies, I will expose, first, a brief of the objects you may find in an Access file. Objects These are the main objects and their meaning: Tables: where the data live. You may imagine them as sheets organised by rows and columns, where the columns are named fields, and the rows are named records. Each field has a data type, that is, all data contained on a field is always the same. Queries: these objects are very useful when you want to combine data of tables. Forms: to show and to enter data, those objects may contain text fields, check boxes, command buttons, text areas, list boxes, and other type of controls. Each form may have linked a module where to write code in VBA programming language for automate its behaviour. Reports: similar to forms, but only

Table and form for window Options in your application

Introduction Today I will explain how to do an Options dialog box with parameters for your application in MS Access. An options window is a simple dialog form. It may be linked to a table, but I prefer to do it using VBA, to have a more professional look and a very good maintenance. This post is organized in six steps: the table, the form, the records, the code in a module, finishing the form, and the code for the form. At the end of this post you may download a small Access file with the form options, the table and the code to manage it. First step: The table For the table, I usually create a table with three fields. The name of the table is Options: parName (text, 50, Primary key): the name of the parameter parValue (text, 50): the value of the parameter Details (text, 255): a brief explanation text field to have information about the field, like a comment. Later in this example we will see that there are different types of values, but the field is always a text fiel