Autofill text box

psych01.png



psych02.png



psych03.png



psych04.png



psych05.png
 
:(

Hi Bob

Thanks fo rputting me straight on that one. However, the information is still not being saved into the table from the form. The control source for Text42 is set to the correct field in the table. I tried putting in that line of code in the BeforeUpdate section of Text42, but that didn't work either. Is there a way to put this code into the actual table itself? Or, do I have to try and do it through the forms in this way.

Thanks :D
 
Sorry, I forgot that the AfterUpdate event doesn't occur with that type of setting. So, move that code to the:

PsychPregrpDevianceScore_AfterUpdate event instead and it works.
 
Almost there...

In the database I've created, when opening the referral form, then adding a new 'Offender', then trying to add a new 'Referrer' - a message comes up saying that it can't find the Key ID of the 'Referrer' in the Referrer Table.

The strange thing is that this message only comes up when I add a new 'Offender'. If I select an 'Offender' who already exists, then I can add a new 'Referrer' without any problems.

What am I doing wrong? I'm sure this was working earlier on in the development, but I don't know what it is I've done to make it come up with this error. I've attached another copy.
 

Attachments

Auto fill Text field

Why not set the ControlSource property to a function, ie =getmembershipstatus()

Function getmembershipstatus()
dim age as byte
age = Forms![FORM NAME]![AGE]
select case age
case
is between whatever and whatever
getmembershipstatus = "Junior"
case etc etc
case else
getmebershipstatus = "?"
end select
end function
 

Users who are viewing this thread

Back
Top Bottom