more qustions! text boxes and default values

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Here is what I’m trying to do

I set up a form, which a user can add a new “agent record†(through the switchboard options), on that form I have

1.a combo box “CSP_Type†(bound to field in a corresponding table [Agent List]![CSP_Type]

2.a text box “Agent_IDâ€(bound to field in a corresponding table “[Agent List]![Agent_ID]â€

3.4 more text boxes “Text_1, Text_2, Text 3, Text 4â€(not bound) but have expressions similar to

a.(=DLast("[Agent List]![Agent_ID]","[Agent List]","[Agent_ID] Between 100 And 198")+1

b.This expression is just supposed to find the last number between 100 and 198 and add 1 thus a new ID can be formed. So I have four of these for four set of numbers 100-198, 200-298, 300-398, 400-498

4.One more text box “Next_Agent-ID†that has the following expressio

a. (=IIf([CSP_Type]="1",[Text_1],IIf([CSP_Type]="2",[Text_2],IIf([CSP_Type]="3",[Text_3],IIf([CSP_Type]="4",[Text_4],IIf([CSP_Type]="5",[Text_4]))))

b.This expression is supposed to pick depending of CSP_Type chosen the correct next agent ID

So, I have gotten everything to work except for the part, which the “Agent_ID†Text box uses “Next_Agent-ID†text box as a default. I have tried simply inputting the name of the text box in the default option on the properties menu and it doesn’t seem to be working. This is why I think that it has something to do with the properties of the form I’m using, but I don’t know. If someone knows what could possibly be impairing my text box to show these default values please let me knowâ€

Thanks a bunch
 
The default value is only used when a new record is shown. When a new
record is created, Next_Agent-ID does not have a vlaue yet. So setting the
default value to this text box results in a blank. It would be better to
leave out the Next_Agent-ID text box and just add code to the AfterUpdate
event of CSP_Type to set Agent_ID to the Text_1, etc.. depending on the
value of CSP_Type.

Select Case Me.CSP_Type
Case 1
Agent_ID = Text_1
Case 2
Agent_ID = Text_2
...
End Select

Kelvin

"more qustions! text boxes/default values"
Here is what I'm trying to do:

I set up a form, which a user can add a new "agent record" (through the
switchboard options), on that form I have:
1.a combo box "CSP_Type" (bound to field in a corresponding table [Agent List]![CSP_Type])

2.a text box "Agent_ID"(bound to field in a corresponding table "[Agent List]![Agent_ID]")

3.4 more text boxes "Text_1, Text_2, Text 3, Text 4"(not bound) but have expressions similar to:

a.(=DLast("[Agent List]![Agent_ID]","[Agent List]","[Agent_ID] Between 100 And 198")+1)

b.This expression is just supposed to find the last number between 100 and
198 and add 1 thus a new ID can be formed. So I have four of these for four
set of numbers 100-198, 200-298, 300-398, 400-498.
4.One more text box "Next_Agent-ID" that has the following expression

a. (=IIf([CSP_Type]="1",[Text_1],IIf([CSP_Type]="2",[Text_2],IIf([CSP_Type]="3"
,[Text_3],IIf([CSP_Type]="4",[Text_4],IIf([CSP_Type]="5",[Text_4])))))

b.This expression is supposed to pick depending of CSP_Type chosen the correct next agent ID.

So, I have gotten everything to work except for the part, which the
"Agent_ID" Text box uses "Next_Agent-ID" text box as a default. I have
tried simply inputting the name of the text box in the default option on the
properties menu and it doesn't seem to be working. This is why I think that
it has something to do with the properties of the form I'm using, but I don'
t know. If someone knows what could possibly be impairing my text box to
show these default values please let me know.
 
Back
Top