Lookup Description Query

G

Guest

I have a database that is used for product inventory. I have a form that I
scan all the incoming equipment into. This form is attached to a table named
inventorymain.

The field names in inventorymain are Part_Number_ID (this is a text field,
and is the primary key), Model Number (this is a text field), Description
(this is a text field) and Qty (number field).

In another table I have a list of part numbers and a cooresponding
description. The name of this table is Sun Parts the field names are Part
Number This is a text field and is the primary key for this table) and
Part_Description (this is text field).

I need to write a query that will automatically get the Part Description
from Table: Part Description when I enter a part number into the
inventorymain form. I have built a query to recover the data but the query is
based on the part number fields being number fields. And I keep getting a
error each time I try and run it for a text field. Can someone tell me how to
rewrite this?

Private Sub Part_Number_AfterUpdate()
'
Dim intSearch As Integer, varX As Variant
'
intSearch = Me!Part_Number.Value
'
varX = DLookup("[Part_Description]", "Sun_Parts", _
"[Part_Number_ID] = " & intSearch)
'
Me!Part_Description.Value = varX

End Sub
 
T

tina

you list the [Part Number] field of table Sun Parts as a text field, but in
your code you're using an Integer (number) data type for your intSearch
variable. you need to change the variable's data type to String, and change
the syntax of your DLookup() function, as

Dim strSearch As String, varX As Variant

strSearch = Me!Part_Number

varX = DLookup("[Part_Description]", "Sun_Parts", _
"[Part_Number_ID] = '" & strSearch & "'")

hth
 
G

Guest

Thanks Tina,
I will give this a try and see how it goes.
--
apps


tina said:
you list the [Part Number] field of table Sun Parts as a text field, but in
your code you're using an Integer (number) data type for your intSearch
variable. you need to change the variable's data type to String, and change
the syntax of your DLookup() function, as

Dim strSearch As String, varX As Variant

strSearch = Me!Part_Number

varX = DLookup("[Part_Description]", "Sun_Parts", _
"[Part_Number_ID] = '" & strSearch & "'")

hth


DS said:
I have a database that is used for product inventory. I have a form that I
scan all the incoming equipment into. This form is attached to a table named
inventorymain.

The field names in inventorymain are Part_Number_ID (this is a text field,
and is the primary key), Model Number (this is a text field), Description
(this is a text field) and Qty (number field).

In another table I have a list of part numbers and a cooresponding
description. The name of this table is Sun Parts the field names are Part
Number This is a text field and is the primary key for this table) and
Part_Description (this is text field).

I need to write a query that will automatically get the Part Description
from Table: Part Description when I enter a part number into the
inventorymain form. I have built a query to recover the data but the query is
based on the part number fields being number fields. And I keep getting a
error each time I try and run it for a text field. Can someone tell me how to
rewrite this?

Private Sub Part_Number_AfterUpdate()
'
Dim intSearch As Integer, varX As Variant
'
intSearch = Me!Part_Number.Value
'
varX = DLookup("[Part_Description]", "Sun_Parts", _
"[Part_Number_ID] = " & intSearch)
'
Me!Part_Description.Value = varX

End Sub
 
G

Guest

Well I tried that code you supplied

Private Sub Part_Number_ID_AfterUpdate()

Dim strSearch As String, varX As Variant

strSearch = Me!Part_Number

varX = DLookup("[Part_Description]", "Sun_Parts", _
"[Part_Number_ID] = '" & strSearch & "'")

Me!Part_Description.Value = varX

End Sub

I then set it up to run "After Update" when I put in the part number I get
an error and the code has this "strSearch = Me!Part_Number" Highlited in
Yellow. And it will still not return the Description. Any ideas?
--
apps


DS said:
Thanks Tina,
I will give this a try and see how it goes.
--
apps


tina said:
you list the [Part Number] field of table Sun Parts as a text field, but in
your code you're using an Integer (number) data type for your intSearch
variable. you need to change the variable's data type to String, and change
the syntax of your DLookup() function, as

Dim strSearch As String, varX As Variant

strSearch = Me!Part_Number

varX = DLookup("[Part_Description]", "Sun_Parts", _
"[Part_Number_ID] = '" & strSearch & "'")

hth


DS said:
I have a database that is used for product inventory. I have a form that I
scan all the incoming equipment into. This form is attached to a table named
inventorymain.

The field names in inventorymain are Part_Number_ID (this is a text field,
and is the primary key), Model Number (this is a text field), Description
(this is a text field) and Qty (number field).

In another table I have a list of part numbers and a cooresponding
description. The name of this table is Sun Parts the field names are Part
Number This is a text field and is the primary key for this table) and
Part_Description (this is text field).

I need to write a query that will automatically get the Part Description
from Table: Part Description when I enter a part number into the
inventorymain form. I have built a query to recover the data but the query is
based on the part number fields being number fields. And I keep getting a
error each time I try and run it for a text field. Can someone tell me how to
rewrite this?

Private Sub Part_Number_AfterUpdate()
'
Dim intSearch As Integer, varX As Variant
'
intSearch = Me!Part_Number.Value
'
varX = DLookup("[Part_Description]", "Sun_Parts", _
"[Part_Number_ID] = " & intSearch)
'
Me!Part_Description.Value = varX

End Sub
 
T

tina

what's the error message?


DS said:
Well I tried that code you supplied

Private Sub Part_Number_ID_AfterUpdate()

Dim strSearch As String, varX As Variant

strSearch = Me!Part_Number

varX = DLookup("[Part_Description]", "Sun_Parts", _
"[Part_Number_ID] = '" & strSearch & "'")

Me!Part_Description.Value = varX

End Sub

I then set it up to run "After Update" when I put in the part number I get
an error and the code has this "strSearch = Me!Part_Number" Highlited in
Yellow. And it will still not return the Description. Any ideas?
--
apps


DS said:
Thanks Tina,
I will give this a try and see how it goes.
--
apps


tina said:
you list the [Part Number] field of table Sun Parts as a text field, but in
your code you're using an Integer (number) data type for your intSearch
variable. you need to change the variable's data type to String, and change
the syntax of your DLookup() function, as

Dim strSearch As String, varX As Variant

strSearch = Me!Part_Number

varX = DLookup("[Part_Description]", "Sun_Parts", _
"[Part_Number_ID] = '" & strSearch & "'")

hth


I have a database that is used for product inventory. I have a form that I
scan all the incoming equipment into. This form is attached to a table
named
inventorymain.

The field names in inventorymain are Part_Number_ID (this is a text field,
and is the primary key), Model Number (this is a text field), Description
(this is a text field) and Qty (number field).

In another table I have a list of part numbers and a cooresponding
description. The name of this table is Sun Parts the field names are Part
Number This is a text field and is the primary key for this table) and
Part_Description (this is text field).

I need to write a query that will automatically get the Part Description
from Table: Part Description when I enter a part number into the
inventorymain form. I have built a query to recover the data but the query
is
based on the part number fields being number fields. And I keep getting a
error each time I try and run it for a text field. Can someone tell me how
to
rewrite this?

Private Sub Part_Number_AfterUpdate()
'
Dim intSearch As Integer, varX As Variant
'
intSearch = Me!Part_Number.Value
'
varX = DLookup("[Part_Description]", "Sun_Parts", _
"[Part_Number_ID] = " & intSearch)
'
Me!Part_Description.Value = varX

End Sub
 
G

Guest

Run-time error '3348':
Cannot add record(s); join key of table 'Sun_Parts' not recordset
--
apps


tina said:
what's the error message?


DS said:
Well I tried that code you supplied

Private Sub Part_Number_ID_AfterUpdate()

Dim strSearch As String, varX As Variant

strSearch = Me!Part_Number

varX = DLookup("[Part_Description]", "Sun_Parts", _
"[Part_Number_ID] = '" & strSearch & "'")

Me!Part_Description.Value = varX

End Sub

I then set it up to run "After Update" when I put in the part number I get
an error and the code has this "strSearch = Me!Part_Number" Highlited in
Yellow. And it will still not return the Description. Any ideas?
--
apps


DS said:
Thanks Tina,
I will give this a try and see how it goes.
--
apps


:

you list the [Part Number] field of table Sun Parts as a text field, but in
your code you're using an Integer (number) data type for your intSearch
variable. you need to change the variable's data type to String, and change
the syntax of your DLookup() function, as

Dim strSearch As String, varX As Variant

strSearch = Me!Part_Number

varX = DLookup("[Part_Description]", "Sun_Parts", _
"[Part_Number_ID] = '" & strSearch & "'")

hth


I have a database that is used for product inventory. I have a form that I
scan all the incoming equipment into. This form is attached to a table
named
inventorymain.

The field names in inventorymain are Part_Number_ID (this is a text field,
and is the primary key), Model Number (this is a text field), Description
(this is a text field) and Qty (number field).

In another table I have a list of part numbers and a cooresponding
description. The name of this table is Sun Parts the field names are Part
Number This is a text field and is the primary key for this table) and
Part_Description (this is text field).

I need to write a query that will automatically get the Part Description
from Table: Part Description when I enter a part number into the
inventorymain form. I have built a query to recover the data but the query
is
based on the part number fields being number fields. And I keep getting a
error each time I try and run it for a text field. Can someone tell me how
to
rewrite this?

Private Sub Part_Number_AfterUpdate()
'
Dim intSearch As Integer, varX As Variant
'
intSearch = Me!Part_Number.Value
'
varX = DLookup("[Part_Description]", "Sun_Parts", _
"[Part_Number_ID] = " & intSearch)
'
Me!Part_Description.Value = varX

End Sub
 
T

tina

well, doesn't make sense to me. i suspect i don't have a clear picture of
what you're doing. you might try moving the code to the control's
BeforeUpdate event, but i wouldn't think that would make a difference.

if the above suggestion doesn't work, and if your db is Access97 or newer,
i'll take a quick look at your setup if you want to send me a copy of the
db. if so, make a COPY of your db and do the following to the COPY:

1. delete any proprietary data (enter some dummy data instead, so i have
something to test against).
2. compact the db.
3. if necessary, zip to under 1 MB. i have WinZip at this end to unzip it.
4. post your email address. make sure you disguise it to avoid the spammers,
something like
myemailaddressDELETECAPITALLETTERS at somewheredotcom

i'll email you and you can send the db copy to me. if you do it today, i can
probably find and fix the problem and mail it back to you this evening so
you can look at my solution.

hth


DS said:
Run-time error '3348':
Cannot add record(s); join key of table 'Sun_Parts' not recordset
--
apps


tina said:
what's the error message?


DS said:
Well I tried that code you supplied

Private Sub Part_Number_ID_AfterUpdate()

Dim strSearch As String, varX As Variant

strSearch = Me!Part_Number

varX = DLookup("[Part_Description]", "Sun_Parts", _
"[Part_Number_ID] = '" & strSearch & "'")

Me!Part_Description.Value = varX

End Sub

I then set it up to run "After Update" when I put in the part number I get
an error and the code has this "strSearch = Me!Part_Number" Highlited in
Yellow. And it will still not return the Description. Any ideas?
--
apps


:

Thanks Tina,
I will give this a try and see how it goes.
--
apps


:

you list the [Part Number] field of table Sun Parts as a text
field,
but in
your code you're using an Integer (number) data type for your intSearch
variable. you need to change the variable's data type to String,
and
change
the syntax of your DLookup() function, as

Dim strSearch As String, varX As Variant

strSearch = Me!Part_Number

varX = DLookup("[Part_Description]", "Sun_Parts", _
"[Part_Number_ID] = '" & strSearch & "'")

hth


I have a database that is used for product inventory. I have a
form
that I
scan all the incoming equipment into. This form is attached to a table
named
inventorymain.

The field names in inventorymain are Part_Number_ID (this is a
text
field,
and is the primary key), Model Number (this is a text field), Description
(this is a text field) and Qty (number field).

In another table I have a list of part numbers and a cooresponding
description. The name of this table is Sun Parts the field names
are
Part
Number This is a text field and is the primary key for this
table)
and
Part_Description (this is text field).

I need to write a query that will automatically get the Part Description
from Table: Part Description when I enter a part number into the
inventorymain form. I have built a query to recover the data but
the
query
is
based on the part number fields being number fields. And I keep getting a
error each time I try and run it for a text field. Can someone
tell
me how
to
rewrite this?

Private Sub Part_Number_AfterUpdate()
'
Dim intSearch As Integer, varX As Variant
'
intSearch = Me!Part_Number.Value
'
varX = DLookup("[Part_Description]", "Sun_Parts", _
"[Part_Number_ID] = " & intSearch)
'
Me!Part_Description.Value = varX

End Sub
 
G

Guest

That would be great it is a basic db anyhow. so I can definitely get it to
you at under 1MB - dan(put a period here)sumnerDELETECAPITALLETTERS at
champsystems(put a period here)net
--
apps


tina said:
well, doesn't make sense to me. i suspect i don't have a clear picture of
what you're doing. you might try moving the code to the control's
BeforeUpdate event, but i wouldn't think that would make a difference.

if the above suggestion doesn't work, and if your db is Access97 or newer,
i'll take a quick look at your setup if you want to send me a copy of the
db. if so, make a COPY of your db and do the following to the COPY:

1. delete any proprietary data (enter some dummy data instead, so i have
something to test against).
2. compact the db.
3. if necessary, zip to under 1 MB. i have WinZip at this end to unzip it.
4. post your email address. make sure you disguise it to avoid the spammers,
something like
myemailaddressDELETECAPITALLETTERS at somewheredotcom

i'll email you and you can send the db copy to me. if you do it today, i can
probably find and fix the problem and mail it back to you this evening so
you can look at my solution.

hth


DS said:
Run-time error '3348':
Cannot add record(s); join key of table 'Sun_Parts' not recordset
--
apps


tina said:
what's the error message?


Well I tried that code you supplied

Private Sub Part_Number_ID_AfterUpdate()

Dim strSearch As String, varX As Variant

strSearch = Me!Part_Number

varX = DLookup("[Part_Description]", "Sun_Parts", _
"[Part_Number_ID] = '" & strSearch & "'")

Me!Part_Description.Value = varX

End Sub

I then set it up to run "After Update" when I put in the part number I get
an error and the code has this "strSearch = Me!Part_Number" Highlited in
Yellow. And it will still not return the Description. Any ideas?
--
apps


:

Thanks Tina,
I will give this a try and see how it goes.
--
apps


:

you list the [Part Number] field of table Sun Parts as a text field,
but in
your code you're using an Integer (number) data type for your
intSearch
variable. you need to change the variable's data type to String, and
change
the syntax of your DLookup() function, as

Dim strSearch As String, varX As Variant

strSearch = Me!Part_Number

varX = DLookup("[Part_Description]", "Sun_Parts", _
"[Part_Number_ID] = '" & strSearch & "'")

hth


I have a database that is used for product inventory. I have a form
that I
scan all the incoming equipment into. This form is attached to a
table
named
inventorymain.

The field names in inventorymain are Part_Number_ID (this is a text
field,
and is the primary key), Model Number (this is a text field),
Description
(this is a text field) and Qty (number field).

In another table I have a list of part numbers and a cooresponding
description. The name of this table is Sun Parts the field names are
Part
Number This is a text field and is the primary key for this table)
and
Part_Description (this is text field).

I need to write a query that will automatically get the Part
Description
from Table: Part Description when I enter a part number into the
inventorymain form. I have built a query to recover the data but the
query
is
based on the part number fields being number fields. And I keep
getting a
error each time I try and run it for a text field. Can someone tell
me how
to
rewrite this?

Private Sub Part_Number_AfterUpdate()
'
Dim intSearch As Integer, varX As Variant
'
intSearch = Me!Part_Number.Value
'
varX = DLookup("[Part_Description]", "Sun_Parts", _
"[Part_Number_ID] = " & intSearch)
'
Me!Part_Description.Value = varX

End Sub
 
T

tina

email on it's way.


DS said:
That would be great it is a basic db anyhow. so I can definitely get it to
you at under 1MB - dan(put a period here)sumnerDELETECAPITALLETTERS at
champsystems(put a period here)net
--
apps


tina said:
well, doesn't make sense to me. i suspect i don't have a clear picture of
what you're doing. you might try moving the code to the control's
BeforeUpdate event, but i wouldn't think that would make a difference.

if the above suggestion doesn't work, and if your db is Access97 or newer,
i'll take a quick look at your setup if you want to send me a copy of the
db. if so, make a COPY of your db and do the following to the COPY:

1. delete any proprietary data (enter some dummy data instead, so i have
something to test against).
2. compact the db.
3. if necessary, zip to under 1 MB. i have WinZip at this end to unzip it.
4. post your email address. make sure you disguise it to avoid the spammers,
something like
myemailaddressDELETECAPITALLETTERS at somewheredotcom

i'll email you and you can send the db copy to me. if you do it today, i can
probably find and fix the problem and mail it back to you this evening so
you can look at my solution.

hth


DS said:
Run-time error '3348':
Cannot add record(s); join key of table 'Sun_Parts' not recordset
--
apps


:

what's the error message?


Well I tried that code you supplied

Private Sub Part_Number_ID_AfterUpdate()

Dim strSearch As String, varX As Variant

strSearch = Me!Part_Number

varX = DLookup("[Part_Description]", "Sun_Parts", _
"[Part_Number_ID] = '" & strSearch & "'")

Me!Part_Description.Value = varX

End Sub

I then set it up to run "After Update" when I put in the part
number I
get
an error and the code has this "strSearch = Me!Part_Number"
Highlited
in
Yellow. And it will still not return the Description. Any ideas?
--
apps


:

Thanks Tina,
I will give this a try and see how it goes.
--
apps


:

you list the [Part Number] field of table Sun Parts as a text field,
but in
your code you're using an Integer (number) data type for your
intSearch
variable. you need to change the variable's data type to
String,
and
change
the syntax of your DLookup() function, as

Dim strSearch As String, varX As Variant

strSearch = Me!Part_Number

varX = DLookup("[Part_Description]", "Sun_Parts", _
"[Part_Number_ID] = '" & strSearch & "'")

hth


I have a database that is used for product inventory. I have
a
form
that I
scan all the incoming equipment into. This form is attached to a
table
named
inventorymain.

The field names in inventorymain are Part_Number_ID (this is
a
text
field,
and is the primary key), Model Number (this is a text field),
Description
(this is a text field) and Qty (number field).

In another table I have a list of part numbers and a cooresponding
description. The name of this table is Sun Parts the field
names
are
Part
Number This is a text field and is the primary key for this table)
and
Part_Description (this is text field).

I need to write a query that will automatically get the Part
Description
from Table: Part Description when I enter a part number into the
inventorymain form. I have built a query to recover the data
but
the
query
is
based on the part number fields being number fields. And I keep
getting a
error each time I try and run it for a text field. Can
someone
tell
me how
to
rewrite this?

Private Sub Part_Number_AfterUpdate()
'
Dim intSearch As Integer, varX As Variant
'
intSearch = Me!Part_Number.Value
'
varX = DLookup("[Part_Description]", "Sun_Parts", _
"[Part_Number_ID] = " & intSearch)
'
Me!Part_Description.Value = varX

End Sub
 
T

tina

after looking at your db, i found that the problem with your form is not in
the AfterUpdate event code. the problem is that your form is NOT bound to
table Inventory Main. it's bound to a recordset made up of the Inventory
Main table INNER JOINed to a query based on the Inventory Main table and the
Sun_Parts table.


i have no idea why you created this recordset for the form, and could see no
reason for it to be necessary. so i simply changed the RecordSource of the
form to table Inventory Main, and then the data entry worked fine.



note: duplicating data (Part_Description) in two tables violates standard
table normalization rules. as long as you have a link between the inventory
table and the parts table (Part_Number_ID field), you can *display* the
description for a specific part from the inventory table in a query, form,
or report - anytime you need to. so you may want to reconsider your decision
to save the part description in the inventory table, since it's already
present in the parts table.



hth



DS said:
Run-time error '3348':
Cannot add record(s); join key of table 'Sun_Parts' not recordset
--
apps


tina said:
what's the error message?


DS said:
Well I tried that code you supplied

Private Sub Part_Number_ID_AfterUpdate()

Dim strSearch As String, varX As Variant

strSearch = Me!Part_Number

varX = DLookup("[Part_Description]", "Sun_Parts", _
"[Part_Number_ID] = '" & strSearch & "'")

Me!Part_Description.Value = varX

End Sub

I then set it up to run "After Update" when I put in the part number I get
an error and the code has this "strSearch = Me!Part_Number" Highlited in
Yellow. And it will still not return the Description. Any ideas?
--
apps


:

Thanks Tina,
I will give this a try and see how it goes.
--
apps


:

you list the [Part Number] field of table Sun Parts as a text
field,
but in
your code you're using an Integer (number) data type for your intSearch
variable. you need to change the variable's data type to String,
and
change
the syntax of your DLookup() function, as

Dim strSearch As String, varX As Variant

strSearch = Me!Part_Number

varX = DLookup("[Part_Description]", "Sun_Parts", _
"[Part_Number_ID] = '" & strSearch & "'")

hth


I have a database that is used for product inventory. I have a
form
that I
scan all the incoming equipment into. This form is attached to a table
named
inventorymain.

The field names in inventorymain are Part_Number_ID (this is a
text
field,
and is the primary key), Model Number (this is a text field), Description
(this is a text field) and Qty (number field).

In another table I have a list of part numbers and a cooresponding
description. The name of this table is Sun Parts the field names
are
Part
Number This is a text field and is the primary key for this
table)
and
Part_Description (this is text field).

I need to write a query that will automatically get the Part Description
from Table: Part Description when I enter a part number into the
inventorymain form. I have built a query to recover the data but
the
query
is
based on the part number fields being number fields. And I keep getting a
error each time I try and run it for a text field. Can someone
tell
me how
to
rewrite this?

Private Sub Part_Number_AfterUpdate()
'
Dim intSearch As Integer, varX As Variant
'
intSearch = Me!Part_Number.Value
'
varX = DLookup("[Part_Description]", "Sun_Parts", _
"[Part_Number_ID] = " & intSearch)
'
Me!Part_Description.Value = varX

End Sub
 
G

Guest

Thanks I will give that a try. I need this to display and be recorded in an
inventory file that can be exported and any given time. I will give a look at
the idea of having the description not record. I will let you know how this
goes.
--
apps


tina said:
after looking at your db, i found that the problem with your form is not in
the AfterUpdate event code. the problem is that your form is NOT bound to
table Inventory Main. it's bound to a recordset made up of the Inventory
Main table INNER JOINed to a query based on the Inventory Main table and the
Sun_Parts table.


i have no idea why you created this recordset for the form, and could see no
reason for it to be necessary. so i simply changed the RecordSource of the
form to table Inventory Main, and then the data entry worked fine.



note: duplicating data (Part_Description) in two tables violates standard
table normalization rules. as long as you have a link between the inventory
table and the parts table (Part_Number_ID field), you can *display* the
description for a specific part from the inventory table in a query, form,
or report - anytime you need to. so you may want to reconsider your decision
to save the part description in the inventory table, since it's already
present in the parts table.



hth



DS said:
Run-time error '3348':
Cannot add record(s); join key of table 'Sun_Parts' not recordset
--
apps


tina said:
what's the error message?


Well I tried that code you supplied

Private Sub Part_Number_ID_AfterUpdate()

Dim strSearch As String, varX As Variant

strSearch = Me!Part_Number

varX = DLookup("[Part_Description]", "Sun_Parts", _
"[Part_Number_ID] = '" & strSearch & "'")

Me!Part_Description.Value = varX

End Sub

I then set it up to run "After Update" when I put in the part number I get
an error and the code has this "strSearch = Me!Part_Number" Highlited in
Yellow. And it will still not return the Description. Any ideas?
--
apps


:

Thanks Tina,
I will give this a try and see how it goes.
--
apps


:

you list the [Part Number] field of table Sun Parts as a text field,
but in
your code you're using an Integer (number) data type for your
intSearch
variable. you need to change the variable's data type to String, and
change
the syntax of your DLookup() function, as

Dim strSearch As String, varX As Variant

strSearch = Me!Part_Number

varX = DLookup("[Part_Description]", "Sun_Parts", _
"[Part_Number_ID] = '" & strSearch & "'")

hth


I have a database that is used for product inventory. I have a form
that I
scan all the incoming equipment into. This form is attached to a
table
named
inventorymain.

The field names in inventorymain are Part_Number_ID (this is a text
field,
and is the primary key), Model Number (this is a text field),
Description
(this is a text field) and Qty (number field).

In another table I have a list of part numbers and a cooresponding
description. The name of this table is Sun Parts the field names are
Part
Number This is a text field and is the primary key for this table)
and
Part_Description (this is text field).

I need to write a query that will automatically get the Part
Description
from Table: Part Description when I enter a part number into the
inventorymain form. I have built a query to recover the data but the
query
is
based on the part number fields being number fields. And I keep
getting a
error each time I try and run it for a text field. Can someone tell
me how
to
rewrite this?

Private Sub Part_Number_AfterUpdate()
'
Dim intSearch As Integer, varX As Variant
'
intSearch = Me!Part_Number.Value
'
varX = DLookup("[Part_Description]", "Sun_Parts", _
"[Part_Number_ID] = " & intSearch)
'
Me!Part_Description.Value = varX

End Sub
 
J

John Vinson

I need this to display and be recorded in an
inventory file that can be exported and any given time.

You may be making the common assumption that you must have all the
data you want to export in the same table.

That assumption, however common, is simply WRONG.

You can export a (multitable joined) Query just as easily as you can
export a Table.

John W. Vinson[MVP]
 
G

Guest

John thanks for the input. I do understand what you are saying. However this
is a raw Description table. I have some editing to do on the Description
before I can send it to the companies we deal with. So I need to bring in the
data and make my changes then send it. I always want to have access to the
raw Descriptions because depending on the need at the time and the client
they may need a more detailed Description. I hope this explains my issue.

Thanks again all. This solution is working very well. Thanks Tina.
 
T

tina

you're welcome :)


DS said:
John thanks for the input. I do understand what you are saying. However this
is a raw Description table. I have some editing to do on the Description
before I can send it to the companies we deal with. So I need to bring in the
data and make my changes then send it. I always want to have access to the
raw Descriptions because depending on the need at the time and the client
they may need a more detailed Description. I hope this explains my issue.

Thanks again all. This solution is working very well. Thanks Tina.
 
G

Guest

Tina,
I have another question. Not sure if I should post a new question or maybe
you could help. I have to now come up with a way for our shipping person to 0
out qtys as he ships inventory out. In some cases this could mean handling as
many as a thousand different parts (rows in the table) and manually 0ing the
qtys. Do you know of a standard way to handle this? A query? A new Code? Any
suggestions would be appreciated.

Need: To be able to scan the serial number into a form and as he scans them
the part details come up from inventory main table and then it 0s itself out,
and then the order is stored in a seperate database or the row is tagged so
that a report can be pulled up to show sales.
 
T

tina

unfortunately, Dan, i have no experience with programming Access to handle
scanned data (a big gap in my skill set, i'm afraid, with the increasing use
of optical scanners in businesses). suggest you start a new thread, probably
in the microsoft.public.access.forms newsgroup. good luck.

hth
 
G

Guest

Hey Tina,
I think you may have misunderstood, I have no problem scanning the data in.
Our scanner does the connect to Access automatically. It will scan the info
in to the form without any problemm. I just need to be able to query for the
data once the info is in the field. Either scanned in or manually entered. So
the data will be input no worries there. What I need is a query or code that
will search the Inventory main and return the complete record based on serial
number and put it in a table that can be manipulated and will automatically
update the field "Quantity" in the inventory main table, and update a new
Table "Sold Items" with the qty, desc, Part Number, Model Number and Machine
Number. This way we will have a record of what has sold. But as I said the
scanner is not the problem just the manipulation of the Data.

Dan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top