Please, please, someone help me with this scenario...

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

Guest

Hi everyone. I have a question about Access, maybe someone can help. Here is
the thing: I have 3 fields in a form, all of them on the same table. One
field is a combo box, with some names. What I want to do is this: when I
select a name from that combo box, the other 2 fields (that contains bank
account numbers and bank names) should automaticaly update with the right
data for that name... I really tried to make it work, but no luck... :(
And another thing...if I have let's say 6 records added in one form, when I
want to print only a specific record all 6 get printed...why?! :(((
Please, if someone could help it would be great...I'm getting
desperate...Thank you in advance!
 
Please search before posting.


From a post yesterday....
You can use the AfterUpdate event of the Listbox to populate bound form
controls with the the corresponding values from the columns (aircode):

Sub Listbox_AfterUpdate()
Me.txtLocationName = Me.ListBox.Column(0)
Me.txtLocationAddress = Me.ListBox.Column(1)
Me.txtLocationCity = Me.ListBox.Column(2)
End Sub
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads:
http://www.datastrat.com
http://www.mvps.org/access
 
and from many many posts on how to print a specific record...


Button to print specific record
Private Sub Print_Button_Click()

If (IsNull([UserID])) Then

' Verify the key field (UserID) has a selection

Exit Sub

End If

DoCmd.OpenReport "SomeReportName", acViewNormal, "","[UserID] =
Forms![frmSomeFormName]![UserID]"

End Sub
 
Hi everyone. I have a question about Access, maybe someone can help. Here is
the thing: I have 3 fields in a form, all of them on the same table. One
field is a combo box, with some names. What I want to do is this: when I
select a name from that combo box, the other 2 fields (that contains bank
account numbers and bank names) should automaticaly update with the right
data for that name... I really tried to make it work, but no luck... :(
And another thing...if I have let's say 6 records added in one form, when I
want to print only a specific record all 6 get printed...why?! :(((
Please, if someone could help it would be great...I'm getting
desperate...Thank you in advance!

A couple of suggestions:

A Form DOES NOT CONTAIN ANY DATA.

A Form is just a tool that lets you edit and display data stored in a
Table. The tables are primary; a Form is just a window.

It sounds like for your first question you want to use the combo box
to *find* and display a particular record in the table... right?

If so, you should add a NEW combo box to the form, using the Toolbox
Wizard. Choose the option "Use this combo box to find a record". If
the wizard isn't cooperative post back, it's not too hard to do
manually.

As for the report... again, the *report* doesn't have any knowledge of
what you want to print, unless you tell it. Try basing the Report on a
Query (not on your table), with a criterion of

=Forms![NameOfYourForm]!{NameOfYourCombo]

using your own form and combo box name of course, on the field which
identifies which record should be printed.

You might want to take a look a the Northwind sample database which
comes with Access, and dig into how some of the forms work; and/or get
one of the good books on Access database design.

John W. Vinson[MVP]
 
Back
Top