Open Form based on Current record without unique ID/Key.

C

CES

All,
I was wondering if there was a way to open a form based only on the current record in focus...

I have a table that has a number of fields one of those fields is a Notes/Memo field. I don't have a unique ID that refers to that specific record, instead I have an ID that refers to all items in a particular invoice.

Within my form I don't have room to place a Notes field for the current record so what I would like to do is just put a button that when pushed would open the Notes field (of the current record) in a separate form pop-up.

This obviously wouldn't be a problem if I had a unique Key to identify the record but I was wondering if there was any other way of doing it without adding a key field to my table.

Thanks in advance. - CES
 
M

Mark A. Sam

It seems like the Notes/Memo field is an unique id. Try using that, however
it is an easy thing to add an Autonumber field to the table. That is what I
would do.

God Bless,

Mark A. Sam
 
R

Ron2006

Here is a possible way.

1) Create a form that has an unbound txtbox on it.
2) In the onOpen event have it do:
me.txtbox = Forms![Nameofthecallingform]![Name of the memo
field]
3) Create a OK or close button on the form and disable any other close
buttons.
4) on that button have it make the form invisible but NOT close
it.

5) using whatever event you want to call that form, call it with
acDialogue
6) When it returns then have your code be
me.[Name of the memo field] = Forms![Nameofthecalledform]!
txtbox
docmd.close "Nameofthecalledform"


Ron
 
C

CES

Ron2006 said:
Here is a possible way.

1) Create a form that has an unbound txtbox on it.
2) In the onOpen event have it do:
me.txtbox = Forms![Nameofthecallingform]![Name of the memo
field]
3) Create a OK or close button on the form and disable any other close
buttons.
4) on that button have it make the form invisible but NOT close
it.

5) using whatever event you want to call that form, call it with
acDialogue
6) When it returns then have your code be
me.[Name of the memo field] = Forms![Nameofthecalledform]!
txtbox
docmd.close "Nameofthecalledform"


Ron

Thanks... I realized that I do have a unique field that I can use as a link criteria. I always put a time/date stamp on my records... so I was able to use that without having to add a unique id/key field. - CES
 

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