473,324 Members | 1,856 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

VBA code for selection form

Hello,

I have made a main form and a sub form. When I click on the ms access standard form filter button I get an error message stating that I can not assign a value to this object. The subform is in datasheet view. What I programmed is that when you go to the next of previous row, some files on the main form are recalculated. But when I want to make a selecting by using the previously mentioned button I get errors. As you probably know some fields are being locked activating this button and greyed out.
Now I am searching for a solution. Should I not use the standard menu button in Access 2002? I can not control it. if you know which method I can use to activate the selection form in which I can enter my selection criteria for the filter to apply on the rows, i will be happy :-).

I hope someone recognize my problem and knows the solution, let me know.
Thanks in advance,
Kind regards,
Gerhard
Feb 23 '07 #1
5 1951
MMcCarthy
14,534 Expert Mod 8TB
Gerhard

Sorry but your question is confusing. Remember we can't see the database and know nothing about it. Read your question again and try posting a more detailed explanation of what you are currently doing, what you are trying to do and what is going wrong.

Mary
Feb 24 '07 #2
Gerhard

Sorry but your question is confusing. Remember we can't see the database and know nothing about it. Read your question again and try posting a more detailed explanation of what you are currently doing, what you are trying to do and what is going wrong.

Mary
Hello Mary,

My database contains transactions which are show in the subform. When entering a new transaction the total turnover of the client to which the transaction applies, which is listed in the main form wil be changed. So when walking through the transactions lines of different customers, the turnover field content changes. But sometimes you want to filter on one customer. Or you want to check the turnover of an other client. For the latter I have 3 combo boxes in the main form so you can choose another client and transaction group then the client stated in the active transaction record in the subform. When I disable the Onfocus function to recaclated the turnover on the client field in the sub form the error does not occur when clicking on the standard form filter button in the ms access menu. But then I lose my recalculation function walking through the transaction lines.

I hope this makes some more clear for you,
thanks in advance again,
kind regards
gerhard
Feb 24 '07 #3
MMcCarthy
14,534 Expert Mod 8TB
The best advice I can give is to apply the filter in code in the On Focus event before running the calculations.

Have a look at this tutorial to see how this can be done.

Example Filtering on a Form

Mary
Feb 24 '07 #4
The best advice I can give is to apply the filter in code in the On Focus event before running the calculations.

Have a look at this tutorial to see how this can be done.

Example Filtering on a Form

Mary
Hello Mary,

Thanks for your answers. I am using the On focus event on the transaction row within the field client. When a client got focus I call a function to recalculate fields on the main form. But when you click on the standaard access form filter button, after which you can enter a criteria per field, I get the error about you can not assign a value to this object when calling the function which recalculates values for fields in the main form. But when I disable error handling by putting a ' before 'On Error GoTo Err_transactie within the recalculate values function I do not get a messge. But this is not the way to solve my problem. Do you know the right way?
Feb 25 '07 #5
NeoPa
32,556 Expert Mod 16PB
Gerhard,
If you are getting an error on your form and you want help finding and fixing this error, you need to post the code where the error occurs and tell us which line it fails on.
Anything that is relevant (referred to by this line or previous lines if necessary) needs to be included also. We cannot tell you what's wrong with your code if we don't even see it.
Feb 26 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: George Hartas | last post by:
I am using Visual C# .NET 2003 to make a ComboBox accept both mouse and keyboard selection. For mouse selection code, I double-clicked ComboBox to get the default "comboBox1_SelectedIndexChanged"...
6
by: Bob Alston | last post by:
I am looking for Access reporting add-in that would be easy to use by end users. My key focus is on selection criteria. I am very happy with the Access report writer capabilities. As far as...
1
by: mr k | last post by:
Hi, I wanted to use mail merge with forms but Text form fields are not retained during mail merge in Word, I got the code from Microsoft but it doesn't remember the text form field options such as...
2
by: emily224 | last post by:
Hello, I have been trying to understand this source code, which I retreived from my online course test. I would like to know how to find the answer for the question on the test. Im sure the answer...
4
by: emily224 | last post by:
Hello, I have been trying to understand this source code, which I retreived from my online course test. I would like to know how to find the answer for the question on the test. Im sure the answer...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.