Update problems

  • I have a SQL2000 DB (linked tables) with an Access front end. I have a field on a form that uses a dlookup. The dlookup field uses the previous entry an Employee Number to get the Employee Name (this is the dlookup field)When I tab or enter into the name field, it should update??? The field will not update unless I exit or scroll away from that record and return. Any ideas on how to get this to update quicker or an I using the wrong tool for the job?

    Thanks for the help in advance

    Kurt

    Kurt Kracaw

  • There are lots of variables here.  Start with this: What are you referring to in the dlookup expression to get the value of the employee number? 

    --If you are referring to the underlying field, the dlookup won't update until you finishe the record update, which is what happens when you scroll away from a record.

    --If you are referring to the control where you type the employee number, the dlookup really should update, as soon as you finish typing the number and tab out of the field.

    This is apparently a bound form, and I'd like to know the names of both the employee number field and the control that's bound to it.

    There are more possibilities, but these are good ones to start with given the info you supplied.

    HTH

     

  • on the after update event of the employee id field, you could put something like:

    Me.EmpName.Requery

    to force it to refresh.

    Dick

     

  • Thanks for the responses - both are appreciated and noted for future reference. I ended up doing the requery worked like a charm.

    thanks again

    Kurt Kracaw

  • Also look into the Resync Command property (on the Data tab of the Form properties). I don't know how it works for DLookup. But, it's critical for using combo boxes in which the ID field is not displayed. When using an ADP, you need to explicitly tell Access how to keep the data synced up.

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply