Jumat, 03 Juni 2011

[MS_AccessPros] Re: Problem with a query, Help!

 

Most of us use forms to gather user input, rather than the [Enter whatever] method. It gives you a lot more control. In that situation, you would use a combo box that displayed the text value to the user ("Activo") but the bound column was the numeric value (2), which is what the query would use.

If you want to stick with the bracket method, the easiest thing that comes to mind is to include the text field in the query (presumably via joining in the lookup table) and put the criteria on that field.

Paul

--- In MS_Access_Professionals@yahoogroups.com, "rivera_vazquez_edgar" <xtintores@...> wrote:
>
> Hello Paul, and thanks for your reply.
> I tried changing the "ACTIVO" criteria for the record autonumber for that value (2) and it worked. The thing is that such field seams to be bound to the first colum (the autonumber). Is there a way to change this so it looks up the actual value? I want to do this because I have the same problem with the 'City' field. In criteria I put [Enter City] and in the pop up i have to put the number of the first colum in the tblCity instead of the actual city name. The problem with this is that I would have to know the corresponding number of a given city everytime I try to run this query, and that doesn't sound too fun. What can I do?
>
> Edgar
>
> --- In MS_Access_Professionals@yahoogroups.com, "Paul" <pbaldy72@> wrote:
> >
> > Two possibilities come to mind. Most likely is that the Status field is numeric, and is expecting 1 (or the appropriate number) instead of "ACTIVO". The other possibility is that a field in the join has incompatible data types, like IdCli is a number in one table and text in the other.
> >
> > Paul
> >
> >
> > --- In MS_Access_Professionals@yahoogroups.com, "rivera_vazquez_edgar" <xtintores@> wrote:
> > >
> > > Hello again...
> > > So I've made all my tables, ralationships and forms and now I'm off to making the querys for my reports. I tried to make my first query and when I try to run it get a message that says "Data type mismatch in criteria expression".
> > >
> > > The SQL is:
> > >
> > > SELECT tblClients.Status, tblClients.Cuenta, tblClients.Company, tblClients.Tel1, tblClients.Tel2, tblClients.Tel3, tblContacts.Title, tblContacts.FirstName, tblContacts.MiddleName, tblContacts.LastName1, tblContacts.LastName2, tblContacts.Nickname, tblContacts.JobTitle, tblContacts.Tel4, tblContacts.Tel5, tblAddress.AddrType, tblAddress.Address, tblAddress.City, tblAddress.Tel6, tblAddress.Tel7
> > > FROM (((tblClients INNER JOIN tblContacts ON tblClients.IdCli = tblContacts.IdCli) INNER JOIN tblAddress ON tblClients.IdCli = tblAddress.IdCli) INNER JOIN tblClientInventory ON tblClients.IdCli = tblClientInventory.IdCli) INNER JOIN tblServices ON tblClientInventory.IdInven = tblServices.IdInven
> > > WHERE (((tblClients.Status)="ACTIVO"));
> > >
> > > Can someone rescue me out of this one?
> > > Thanks a lot, Edgar
> > >
> >
>

__._,_.___
Recent Activity:
MARKETPLACE

Stay on top of your group activity without leaving the page you're on - Get the Yahoo! Toolbar now.


Get great advice about dogs and cats. Visit the Dog & Cat Answers Center.

.

__,_._,___

Tidak ada komentar:

Posting Komentar