473,396 Members | 2,013 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,396 software developers and data experts.

Form update

Using Access 2003 and Windows XP

The form displays data about an employee (Their SSN, Name, etc). It also displays what company that employee belongs to in a combobox (Ex A204-04,C204-04), along with how many people are assigned to the company (Assigned to A204-04, Assigned to C204-04)

For example purposes, employees 1,2, and 3 are assigned to companyNum A204-04. If in the first record (Employee 1), I change the company to C204-04, I want to subtract 1 from assigned to A204-04, and add 1 to C204-04.

Right now I am using the On Change property for the combo box to add 1 to the destination company. It adds correctly, however the combo box is then "locked" I can click on it, and the options are listed, but it won't let me choose another one.

Also I'm trying to figure out how to decrement the starting assigned value. I've tried On Enter, On Click, On Got Focus, but for all of these, as soon as the assigned value changes, the combobox is "locked" again.

I can go to the next record (Employee 2), and it will allow the combobox to be used again, until on of the assigned values is changed. Does it have something to do with saving the form? I tried running a macro to save the form when the vaue in assigned changes, but that didn't work either. Any help would be appreciated.
Piko
Mar 6 '07 #1
5 1386
Rabbit
12,516 Expert Mod 8TB
1) Are you storing these totals in your table? It's better if you don't do that.

2) You say you're using code but we can't help you unless you post the code so we can see if anything's wrong with it.
Mar 6 '07 #2
I know storing totals isn't the best way to do things.... but if all else fails I will explain the situation better to try and emphasize what I'm doing....

Here's the code for when you click on the companyNum combobox
Private Sub companyNum_Enter()
Dim subtractAssign As String
subtractAssign = Left(companyNum, 1)
Select Case subtractAssign
Case "A"
Alpha_Assigned = Alpha_Assigned - 1
Case "C"
Charlie_Assigned = Charlie_Assigned - 1
End Select
End Sub


Secondly the code for after update.... Note.... the record changes before the update happens, so I put the add assigned here

Private Sub companyNum_Change()
Dim subtractAssign As String
Me.Requery
subtractAssign = Left(companyNum, 1)
Select Case subtractAssign
Case "A"
Alpha_Assigned = Alpha_Assigned + 1
Case "C"
Charlie_Assigned = Charlie_Assigned + 1
End Select
End Sub

Let me know what u think
Mar 6 '07 #3
I've only done the code for Alpha and Charlie so far just for testing purposes, the final would have HHSB, A, B, C
Mar 6 '07 #4
I also have anoth post..... question about a table which further descrbies why I have the authorized and assigned numbers all in the same table, please read that one as well. Thanks,
Piko
Mar 6 '07 #5
NeoPa
32,556 Expert Mod 16PB
You'll see Mary issues similar advice there ;)
(Question about a Table)
Mar 7 '07 #6

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

Similar topics

4
by: Eric | last post by:
Hey Everyone.. I have a form that has approximately 7 text fields and 1 checkbox. Generally when this form is submitted(to itself BTW) it works fine, however, when the checkbox is only field...
2
by: Bill S. | last post by:
Hi, I am just starting to work with ASP, so bear that in mind... I have an ASP page that displays records from a table, and allows you to add, update and delete. There is a form with one...
9
by: cooldv | last post by:
i know how to replace the sign " when SUBMITTING a form in asp by this code: message = Replace(usermessage, "'", "''"). My problem is DISPLAYING data in an asp FORM, from an an access database,...
2
by: Lyn | last post by:
Hi, I am working on a genealogy project in which I have two tables: Person -- one record for each person in the family. Each record has a unique Autonum field (IDPerson). Partnerships -- one...
16
by: Adda | last post by:
If I cycle through the MdiChildActivate event of the parent form I can read text in a textbox on the child mdiform -- console.writeline(Me.ActiveMdiChild.Controls(1).Text) But if I have a sub...
5
by: ortaias | last post by:
I have a form which calls up a second form for purposes of data entry. When closing the data entry form and returning to the main form, things don't work as expected. When I return to the main...
6
by: Henry Stockbridge | last post by:
Hi, I have a popup that is used to update the records on an open form. I cannot get form to refresh with the new values. Any help you can lend would be appreciated. Here is the code for the...
2
by: devine | last post by:
Hi All, I am trying to send an automatic email when an update has been made. My update statement will updates 6 fields, and dependant on one of the fields, I would like to send an email using CDO....
5
by: Miro | last post by:
I will try my best to ask this question correctly. I think in the end the code will make more sence of what I am trying to accomplish. I am just not sure of what to search for on the net. I...
1
by: chromis | last post by:
Hi, I'm having trouble fully implementing the edit section of a contact admin system, so far I have written the following: - Bean (Contact.cfc) - Data Access object (ContactDAO.cfc) - Gateway...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.