A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

dropdown list cbo to find record



 
 
Thread Tools Display Modes
  #21  
Old January 21st, 2009, 11:02 PM posted to microsoft.public.access.forms
strive4peace
external usenet poster
 
Posts: 1,670
Default dropdown list cbo to find record

Hi Corrine,

base you form on just one table -- I believe that is the root of your
problem at this point

Warm Regards,
Crystal

remote programming and training

Access Basics
8-part free tutorial that covers essentials in Access
http://www.AccessMVP.com/strive4peace

*
(: have an awesome day
*




Corrine wrote:
I know queries don't store info. I want the same info it is pulling to be
accessible via my form. That was why I chose the query as my record source.

There are no lookup fields in my tables.

"strive4peace" wrote:

Hi Corrine,

a query does not store information, it pulls information from tables --
so if your query uses two tables, then so does your form ... and herein
lies the problem...

Why are you using 2 tables in the form RecordSource?

~~~
The tables are linked through the company ID, though, not the name

If you are using a combobox as the DisplayControl in the related table,
you should switch it to textbox. Don't use lookup fields in table design

The Evils of Lookup Fields in Tables
http://www.mvps.org/access/lookupfields.htm



Warm Regards,
Crystal

remote programming and training

Access Basics
8-part free tutorial that covers essentials in Access
http://www.AccessMVP.com/strive4peace

*
(: have an awesome day
*




Corrine wrote:
Wait! I lied! This form is based on a query, not my tables. The query is
based on the two forms. Because it's pulling information from the query it
shouldn't matter that the information was originally found in two tables.
Hmm. Is that square one I see again?

"Corrine" wrote:

(That was wierd. It posted my last reply twice!)

AllowEdit = yes for the form.

The combo box is from my tbl "Company" and the rest of the form's
information is coming from my tbl "Agreement". The idea was that picking the
company name from the combo box the agreement info will appear. The tables
are linked through the company ID, though, not the name, now that I think of
it.

Thanks for the suggestion.

"strive4peace" wrote:

Hi Corrine,

it is perfectly fine for the RowSource of a combo to list values from
the same table

is AllowEdits = yes for the form?

Is the form based on just ONE table? If the form RecordSource is based
on multiple tables, you may not be able to edit or add information. It
is, therefore, best to base each form and subform on just one table.

"This database is making me feel stupid!"

read Access Basics -- it is just 100 pages, has lots of screen shots,
and should give you more confidence

Access Basics
8-part free tutorial that covers essentials in Access
http://www.AccessMVP.com/strive4peace


Warm Regards,
Crystal
remote programming and training

*
(: have an awesome day
*




Corrine wrote:
Crystal,

Yes, Locked=False.

I just thought of something. The info for the combo box is being pulled from
a different table than for the rest of the form. Could that be causing any
trouble?

It seems to be having trouble with this part of the code:
DoCmd.RunCommand acCmdRecordsGoToNew
End If

Thank you for your help! This database is making me feel stupid!

"strive4peace" wrote:

Hi Corrine,

"now I'm back to my original problem"
not sure which original problem you mean ... not being able to pick
something?
is Locked = False
for the control?

"It's giving me a "syntax error" for that coding."

please post the line that the compiler is stopping on

Warm Regards,
Crystal

remote programming and training

Access Basics
8-part free tutorial that covers essentials in Access
http://www.AccessMVP.com/strive4peace

*
(: have an awesome day
*




Corrine wrote:
AllowEdits was already True, but I had Enable = No. I turned Enable back to
Yes, but now I'm back to my original problem.

It's giving me a "syntax error" for that coding.

"strive4peace" wrote:

Hi Corrine,

if the combo won't drop, then my guess is that the control is not
enabled or you have AllowEdits = False for the form

~~~
to go a new record when a form is opened, put this code in the [Event
Procedure] for the form LOAD event:

'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Private Sub Form_Load()
If Not Me.NewRecord Then
DoCmd.RunCommand acCmdRecordsGoToNew
End If
End Sub
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

If the user doesn't type anything, the new record will not be saved



Warm Regards,
Crystal

remote programming and training

Access Basics
8-part free tutorial that covers essentials in Access
http://www.AccessMVP.com/strive4peace

*
(: have an awesome day
*




Corrine wrote:
Tried it both ways. Dropdown still won't work.

Also, or in the meantime, how do I get the form to open by default as blank
and not populate until I choose something from the dropdown list?

Thanks for your help!

"strive4peace" wrote:

Corrine and Tori,

oh, hey, I totally forgot about this...

for a form where you do not want to allow changes to the data, make the
form RecordsetType -- Snapshot

that way, you do not have to deal with Locked or Enabled for the
controls -- just leave them set to the defaults

you will be able to change anything that is not bound to the underlying
RecordSource, such as a 'find combo'

Warm Regards,
Crystal

remote programming and training

Access Basics
8-part free tutorial that covers essentials in Access
http://www.AccessMVP.com/strive4peace

*
(: have an awesome day
*




strive4peace wrote:
Hi Corrine,

make sure that, for the combo:

Locked -- No (False)
Enabled -- Yes (True)

this is opposite of what it should be for your data controls

Warm Regards,
Crystal

remote programming and training

Access Basics
8-part free tutorial that covers essentials in Access
http://www.AccessMVP.com/strive4peace

*
(: have an awesome day
*




Corrine wrote:
Now the dropdown won't open at all.

"strive4peace" wrote:

Hi Corrine,

"The dropdown list will open, but I cannot select anything from the
list. This form needs to be only for running searches, not for
editing in any way."

My guess is that you have the form AllowEdits property set to False

If you want the user to be able to edit the search combo, instead do
this:

for each control, set:
Locked = True
and. optionally,
Enabled = False

and set AllowEdits = True for the form

Warm Regards,
Crystal

remote programming and training

Access Basics
8-part free tutorial that covers essentials in Access
http://www.AccessMVP.com/strive4peace

*
(: have an awesome day
*




Corrine wrote:
I have a form with a dropdown list from which I want to be able to
select an item and have the rest of the form populate additional
fields with that record's information. Preferrably the form will
start out blank. Currently it is automatically populating with the
first record and is only letting me use the navigation buttons (at
the bottom of my form) to move from record to record. The dropdown
list will open, but I cannot select anything from the list. This
form needs to be only for running searches, not for editing in any
way. Suggestions? I'm working in Access '07.

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 03:26 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.