Pls. help! I'm stuck on a problem

nisa

Registered User.
Local time
Today, 15:05
Joined
Aug 15, 2007
Messages
24
Hi.

I'm totally new to Access, and is currently quite stuck on a problem.

The problem is that in Forms, I've created a drop/combibox containing a lot of values, but when I chose one of these values, then the rest of the fields automatically fills out with the same value where it ought to be standarvalue which is 0.

Besides it resets when I close down the form.

Does anyone know a way of dealing with this problem? I'm totally lost at the moment :(
 
You need to bind the combobox to a field in a table or query that is in the recordsource of your form. Look in the properties of your combo box, Click on the Data tab, and in the Control Source field (usually the top one). If that's blank then your combobox is not bound to any fields. There should be a down arrow to the right of the empty field, click on that and it should list all the fields in the table that the form is bound to. Pick the appropriate one and it should work ok. If there are no fields in the list, then your form is not bound to a table or query and you need to first pick the Record Source for your Form.
 
I followed your lead, but now apparently it says that I can't, 'cuz I'm creating a time managing system, create a new form for a new employee, 'cuz that would demand a change in one of the forms (read: the one I just created...)
 
Why are you creating a 'new' form instead of just editing the existing one in design view?

Perhaps if you post a stripped down, zipped copy of the db and tell me what form and control/field you're having a problem with, I or someone else will be able to assist you more effectively.
 
Ok here we go... It's in Danish, 'cuz it's made for a Danish company:

The problem I'm running into is called "Arbejdssedler" --> "Antal Rek", and the problem lies in the control field is joined with "Antal Rek" in a combobox.

The problem is, as attempted to say before, is that I can't add a new employee under this form... Create a new timeschedual (or what it's called)
 

Attachments

What version of Access are you using? I have Access 2000 and something appears to be wrong with the file you posted since no tables or other objects aside from the form Arbejdssedler appear to be present in the db.

As an aside, you also appear to be using some unfortunate naming conventions. For example, you apparently have a subform or subreport call 'Arbejdssedler - underformular'. You should never use spaces in object or field names in Access as these can create problems in code. Try something like Arbejdssedler_underformular instead.
 
Oh sorry I think I've misunderstood you... I singled out the form I have problems with, and not the entire db... might be why you get problems... I'll try to repost the entire db then

BTW: underformular means subform
 

Attachments

Sorry, stripped down db means to remove any data in the db that you don't wish to share publically.

Re-reading your posts this seems to be a different problem than the original one. Am I right in interpreting your problem to be that you do not know how to add a new employee to the drop down list in the combo box on the Arbejdssedler form?

If so, then to add a new employee to the list you will need some code in the NotInList event of the combo box and you will need to create another form that is bound to your employee table (Medarbejder?). Let's call the new form fmMedarbejder (which should have the table Medarbejder as its record source). Design it to look however you want then save and close it.

Then, in the not in list event of the combo box in the Arbejdssedler form, place the following code:
Code:
Dim intAnswer As Integer

intAnswer = MsgBox("Ville jer have lyst til sammenlægge indeværende værdi hen til den liste?", vbYesNo, vbQuestion)
If intAnswer = vbYes Then
DoCmd.RunCommand acCmdUndo
DoCmd.OpenForm "fmMedarbejder", acNormal, , , acFormAdd, acDialog
Response = acDataErrAdded
Else
MsgBox "Behage sluttet en ansat af den liste hvis eller.", vbInformation
Response = acDataErrContinue
End If

(Apologies if the english to danish translation didn't work too well as I don't speak a word of danish.)

When you enter a new name, the not in list event should ask you if you want to add a new employee to the list. If you say yes, then your new form should appear and allow you to enter the new details. Then close that form and the name should appear in your combo box list. If you instead say no, then you should get a message prompting you to select a person who is already in the drop down list.
 
Now it works... thank you very much for your help... :D
 

Users who are viewing this thread

Back
Top Bottom