Ask Your Question

Macro wich auto fill form #BASE

asked 2017-08-30 05:13:08 +0200

WilliamLibreoffice gravatar image

Good Night people. My ask is about auto fill in forms, for example if I have a costumer who have a profile in my base, and I wold to save a new sell to him, I wold like, when I put her name into the form, other informations auto fill, like code poste and the city where he lives. I Would only need, put into the form the item, wich he bought. Or another example, if I have a table, wich I have my products and its codes. I would like, when I write the code in the subform, autocomplete the others fields into de subform, for example the name of the product, or some information wich I have in that table. Can someone help me?

edit retag flag offensive close merge delete

2 Answers

Sort by » oldest newest most voted

answered 2017-08-30 19:41:20 +0200

Ratslinger gravatar image

updated 2017-08-30 19:53:43 +0200

Macros should be avoided whenever possible. Many times they are not necessary. Have attached sample which uses a list box and a table filter to select the wanted company. Two forms are included. One without a macro which after selection requires you to press the button to retrieve the customer. The second form uses a very small macro to automatically retrieve the customer from the selection without a button.

This type of situation can easily be adopted to your requirements.

Sample: SelectCompanyByFilter2.odb

If this answers your question please click on the ✔ (upper left area of answer).

edit flag offensive delete link more

answered 2017-11-20 15:41:57 +0200

this post is marked as community wiki

This post is a wiki. Anyone with karma >75 is welcome to improve it.


I saw this forum over here and I have the same question, but I am using a MAC OS 2011. I downloaded the file above, it is work on MAC, but I tried to repeat the same commands but it is not working. (I tried to use the form with no macro).

Nothing happens when select button is clicked.

I don't have enough Karma to upload my file.

Thank you. Victor

edit flag offensive delete link more


Hello Victor, First do not use Wiki for posting. Second, do not ask a question as an answer. Answers are to respond to the original question. Use comments. Now as you state the downloaded sample works so you must not have set something correctly. Check the following. Make sure the filter table is in place and set correctly. Make sure you have internal forms set correctly (sample has three). Make sure Button is on the SubForm not the MainForm. Continued ->

Ratslinger gravatar imageRatslinger ( 2017-11-20 16:05:01 +0200 )edit

Make sure Button property for Action is set to Refresh form. If after all of this you are still having a problem, post a NEW question stating your problem with what is happening and also refer to this original question.

Ratslinger gravatar imageRatslinger ( 2017-11-20 16:07:42 +0200 )edit

Thank you for your answer. SOrry about the misunderstood how to use this forum.

VHM gravatar imageVHM ( 2017-11-25 20:36:00 +0200 )edit
Login/Signup to Answer

Question Tools

1 follower


Asked: 2017-08-30 05:13:08 +0200

Seen: 353 times

Last updated: Nov 20 '17