Automatic field update

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

Guest

i sell training courses
i have a lookup table which stores the name and cost of each course

when i register a client i select the appropriate course from a drop-down
list (populated by the lookup table)
i WANT the cost to be updated/inserted automatically when the course is
selected

i did this years ago using a macro, but i am totally stumped now!

re. my earlier post..."examples database"...i am sure there was an exact
replica of this in the 97 solutions database, but can't find it in the
solutions db available now

jimaldo
ps macro help would be great as my VBA is NVG (Not Very Good!) :)
 
i sell training courses
i have a lookup table which stores the name and cost of each course

when i register a client i select the appropriate course from a drop-down
list (populated by the lookup table)
i WANT the cost to be updated/inserted automatically when the course is
selected

i did this years ago using a macro, but i am totally stumped now!

re. my earlier post..."examples database"...i am sure there was an exact
replica of this in the 97 solutions database, but can't find it in the
solutions db available now

jimaldo
ps macro help would be great as my VBA is NVG (Not Very Good!) :)

Well... my macro coding is pretty weak; I never use them because they are less
capable, less flexible, and (for me) harder to understand than VBA. That said:
use the combo box's AfterUpdate event to "push" the value into the bound cost
control. The VBA code would be

Private Sub comboboxname_AfterUpdate()
Me.costtextboxname = Me.comboboxname.Column(n)
End Sub

where n is the zero based position of the cost field (e.g. if the cost is the
third column of the combo, use (2)).

John W. Vinson [MVP]
 
it's the column number!!!!!!!!

thank you

jimaldo

ps. i haven't done it yet, but as soon as i seen your reply i remembered
what was missing!"
 
John

still can't remember the syntax for the macro, but the VBA code worked a
treat (not only that, but you even got the column number right...spooky!)

thanks again

jimaldo
 
(not only that, but you even got the column number right...spooky!)

The Wysard of Information has ways of knowing these things... <bg>

John W. Vinson [MVP]
 
Back
Top