Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Make Table Number Field Issue!!

Status
Not open for further replies.

Clarkie001

IS-IT--Management
Aug 26, 2003
59
GB
Hi,

I have a field within a make table query which does a dlookup up on another table.

The issue is, when I run the make table query, this field is returned as Text when it should be a number. This is causing issues, as I wish to use this newly created table in another link.

Does anyone have any ideas, thanks in advance.


Clarkie
 
DLookup returns a variant(string).
Val(DLookup(...)) should turn it into a number.
Val(Nz(DLookup(...), 0)) should take care of nulls and turn them to zeroes.

And another name for Make-Table queries is 'Make-Trouble'
See if you really need it, if not, dump it.

HTH




[pipe]
Daniel Vlas
Systems Consultant

 
Daniel,

Its the simple things in life that make this job easier....thanks.


Clarkie
 
Daniel,

Its is now returning as number, but as double is there anyway of changing that to Interger?


Clarkie
 
Try Int(Val(DLookup(...)))

But I'm not sure it works...

You could do something else:
Design the table as you want it, then:
- run a delete query to remove all records
- run an append query to put the records in the table (simple change of your Make-Table into an Append)

Performance stays the same (slow, database size increases), but at least you have the fields defined as you want them.

HTH


[pipe]
Daniel Vlas
Systems Consultant

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top