display value in response w/ an event

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

Guest

the offline help only gives examples of values set with the same values.. pls
help me with these..

i wanted to display the 'BkTitle' value in a textbox after having selected a
corresponding 'BkId' from a combobox.. could someone provide me codes for
this?.. not using the code builder would be preferrable..

also, when i place a 'refresh' button in the form, it doesn't function
properly.. it says that "The command or action 'Refresh' isn't available
now".. pls do help me before sunrise!!.. huhu..

tnx!!.. i humby remain..
 
you can make a calculated field

if BkTitle is the second column of the BkID combobox

ControlSource --> = BkID_controlname.Column(1)

since column indexeing starts with 0, column 1 is really
column 2

alternately, you can set the column widths of the BkID
combobox to show the BkTitle and hide the BkID

ColumnWidths --> 0;2


Have an awesome day

Warm Regards,
Crystal

MVP Microsoft Access

remote programming and training
strive4peace2006 at yahoo.com
 
it does not work.. it says "#Name?"

strive4peace said:
you can make a calculated field

if BkTitle is the second column of the BkID combobox

ControlSource --> = BkID_controlname.Column(1)

since column indexeing starts with 0, column 1 is really
column 2

alternately, you can set the column widths of the BkID
combobox to show the BkTitle and hide the BkID

ColumnWidths --> 0;2


Have an awesome day

Warm Regards,
Crystal

MVP Microsoft Access

remote programming and training
strive4peace2006 at yahoo.com
 
i just learned in vb..
here are my codes:

Dim dbs As Database
Dim qdf As QueryDef
Dim strSQL As String
Dim ctrl As Control
Dim temp As String

temp = Forms!Borrow!StudId.Text

Set dbs = CurrentDb
strSQL = "SELECT StudName FROM Students WHERE StudId = " & temp & ";"

Set qdf = dbs.CreateQueryDef("", strSQL)

Set ctrl = Forms!Borrow!StudName
DoCmd.GoToControl ctrl.Name
StudName.Text = strSQL


it says: "the text is too long to be edited"
 
BkID_controlname

refers to the NAME property of the control with BkID

turn on the Properties window
from the menu --> View, Properties

click on the BKID combobox

look at the NAME property (first property on All and Other tabs)

you should change the name property to something logical

Have an awesome day

Warm Regards,
Crystal

MVP Microsoft Access

remote programming and training
strive4peace2006 at yahoo.com
 
You should not be using code to fill this field (... and the
code is not right anyway -- you are setting StudName = to
your SQL statement, not the results of it...)

do this: make StudID a combobox

Name of combobox control = StudID

first column = StudID
second column = StudName

ControlSource for StudName --> =StudID.column(1)

since you are storing StudID, you should not be storing
StudName in a related table as you can link to that
information anytime

Have an awesome day

Warm Regards,
Crystal

MVP Microsoft Access

remote programming and training
strive4peace2006 at yahoo.com
 
Back
Top