Lookup text box
My DB is used to order materials for a number of different building
sites. I have a form for the orders which lists the obvious details
of whats being ordered etc. each site has a reference number and each
order has a unique order number. i.e a site may be site number 12 and
the order number 1274. when i place the orders we give the supplier a
purchase order number which basically combines the two i.e 12/1274 -
basically to help the admin staff match the order to the invoice
later.
what i want to do is add an unbound text box to the form that combines
the 2 selections from the fields. i.e. display an output of site ref/
order number. how would i go about doing this? i have a similar box
to show the phone number of the site contact when his name is selected
but have no idea how to get the "/" into the output. i appreciate
both fields are already displayed on the form but combining them will
make things easier when checking invoices (i still need them to be
stored as seperate details i.e. i'm not looking to change my keys just
to use the exisiting keys to provide a new output)
Re: Lookup text box
themastertaylor [at] hotmail.com wrote:
> My DB is used to order materials for a number of different building
> sites. I have a form for the orders which lists the obvious details
> of whats being ordered etc. each site has a reference number and each
> order has a unique order number. i.e a site may be site number 12 and
> the order number 1274. when i place the orders we give the supplier a
> purchase order number which basically combines the two i.e 12/1274 -
> basically to help the admin staff match the order to the invoice
> later.
>
> what i want to do is add an unbound text box to the form that combines
> the 2 selections from the fields. i.e. display an output of site ref/
> order number. how would i go about doing this? i have a similar box
> to show the phone number of the site contact when his name is selected
> but have no idea how to get the "/" into the output. i appreciate
> both fields are already displayed on the form but combining them will
> make things easier when checking invoices (i still need them to be
> stored as seperate details i.e. i'm not looking to change my keys just
> to use the exisiting keys to provide a new output)
In your query for the recordsource you could create a calculated field.
SitePO : SiteNumber & "/" & PONumber
Then drag that field onto your form.
Of course, you could create a field as well, but will repaint and may
not look as neat as putting it in the recordsource. Create an unbound
textbox and in the control source enter
=[SiteNumber] & "/" & [PONumber]
Booty
http://www.youtube.com/watch?v=VuI2wdcoxrw
Re: Lookup text box
On 4 Jan, 17:31, Salad <o... [at] vinegar.com> wrote:
> themastertay... [at] hotmail.com wrote:
> > My DB is used to order materials for a number of different building
> > sites. =A0I have a form for the orders which lists the obvious details
> > of whats being ordered etc. =A0each site has a reference number and each=
> > order has a unique order number. =A0i.e a site may be site number 12 and=
> > the order number 1274. =A0when i place the orders we give the supplier a=
> > purchase order number which basically combines the two i.e 12/1274 -
> > basically to help the admin staff match the order to the invoice
> > later.
>
> > what i want to do is add an unbound text box to the form that combines
> > the 2 selections from the fields. =A0i.e. display an output of site ref/=
> > order number. =A0how would i go about doing this? =A0i have a similar bo=
x
> > to show the phone number of the site contact when his name is selected
> > but have no idea how to get the "/" into the output. =A0i appreciate
> > both fields are already displayed on the form but combining them will
> > make things easier when checking invoices (i still need them to be
> > stored as seperate details i.e. i'm not looking to change my keys just
> > to use the exisiting keys to provide a new output)
>
> In your query for the recordsource you could create a calculated field.
> =A0 =A0 =A0 =A0 SitePO : SiteNumber & =A0"/" & PONumber
> Then drag that field onto your form.
>
> Of course, you could create a field as well, but will repaint and may
> not look as neat as putting it in the recordsource. =A0Create an unbound
> textbox and in the control source enter
> =A0 =3D[SiteNumber] & =A0"/" & [PONumber]
>
> Bootyhttp://www.youtube.com/watch?v=3DVuI2wdcoxrw- Hide quoted text -
>
> - Show quoted text -
Thanks, worked perfectly had to use the field approach as the form
serves as a data input as well as editing hence no query in place. my
other problem is that the materials are sorted by category to avoid
massive lists. for example standard red bricks are under bricks and
blocks. this operates as a combobox whereby the actual item list is
populated once the category is selected using the following script
Private Sub ItemCategory_AfterUpdate()
With Me![Item]
If IsNull(Me!ItemCategory) Then
.RowSource =3D ""
Else
.RowSource =3D "SELECT [description] " & _
"FROM materials " & _
"WHERE [categoryid]=3D" & Me!ItemCategory
End If
Call .Requery
End With
End Sub
Is it possible to sort the populated results alphabetically or am i
stuck with them as they are?
Re: Lookup text box
themastertaylor [at] hotmail.com wrote:
> On 4 Jan, 17:31, Salad <o... [at] vinegar.com> wrote:
>
>>themastertay... [at] hotmail.com wrote:
>>
>>>My DB is used to order materials for a number of different building
>>>sites. I have a form for the orders which lists the obvious details
>>>of whats being ordered etc. each site has a reference number and each
>>>order has a unique order number. i.e a site may be site number 12 and
>>>the order number 1274. when i place the orders we give the supplier a
>>>purchase order number which basically combines the two i.e 12/1274 -
>>>basically to help the admin staff match the order to the invoice
>>>later.
>>
>>>what i want to do is add an unbound text box to the form that combines
>>>the 2 selections from the fields. i.e. display an output of site ref/
>>>order number. how would i go about doing this? i have a similar box
>>>to show the phone number of the site contact when his name is selected
>>>but have no idea how to get the "/" into the output. i appreciate
>>>both fields are already displayed on the form but combining them will
>>>make things easier when checking invoices (i still need them to be
>>>stored as seperate details i.e. i'm not looking to change my keys just
>>>to use the exisiting keys to provide a new output)
>>
>>In your query for the recordsource you could create a calculated field.
>> SitePO : SiteNumber & "/" & PONumber
>>Then drag that field onto your form.
>>
>>Of course, you could create a field as well, but will repaint and may
>>not look as neat as putting it in the recordsource. Create an unbound
>>textbox and in the control source enter
>> =[SiteNumber] & "/" & [PONumber]
>>
>>Bootyhttp://www.youtube.com/watch?v=VuI2wdcoxrw- Hide quoted text -
>>
>>- Show quoted text -
>
>
> Thanks, worked perfectly had to use the field approach as the form
> serves as a data input as well as editing hence no query in place. my
> other problem is that the materials are sorted by category to avoid
> massive lists. for example standard red bricks are under bricks and
> blocks. this operates as a combobox whereby the actual item list is
> populated once the category is selected using the following script
>
> Private Sub ItemCategory_AfterUpdate()
> With Me![Item]
> If IsNull(Me!ItemCategory) Then
> .RowSource = ""
> Else
> .RowSource = "SELECT [description] " & _
> "FROM materials " & _
> "WHERE [categoryid]=" & Me!ItemCategory
> End If
> Call .Requery
> End With
> End Sub
>
> Is it possible to sort the populated results alphabetically or am i
> stuck with them as they are?
I think so. The first method is to add the order clause on your sql
statement.
.RowSource = "SELECT [description] " & _
"FROM materials " & _
"WHERE [categoryid]=" & Me!ItemCategory & _
" Order By Whatever"
Or you can specify the order in some event.
Me.OrderBy = "Whatever"
Me.OrderByOn = True
Laffy Taffy
http://www.youtube.com/watch?v=Bvy63Yl7qU8