Delete Fields?

  • Thread starter Thread starter Barcode
  • Start date Start date
B

Barcode

Hi,

When I delete a post by buttom code then I see that all fields labeled with
"Remove" word instead of being empty (space),
I am looking for a suggestion may be a modification in the VB code in MS
Access 2007,
I do after the removing oparation Me.Refresh code but it still showing
"Remove".
And when I add DoCmd.Requery code it shows another post which I don't want
to see it.
May I add "goto" function, in order to go to new empty post?
If that is the solution so how may I do that?

Thank you.
 
After the delete code's last step, try putting this as the last step to move
to the previous record):

Me.Recordset.Move -1
 
Thank you for helping.

Thare are 2 tables, table1 and table2, the relationship between them is 1-M.
When I click on the form in table1 and delete a post field from table2, your
code is working great, but when I delete a post from table1, that code
haven't any affect !
so it still shows all fields "Delete" words, so may you find an intelligable
solution?

Thanks a lot.
 
Hello

Thank you for your answering. here is the delete commando

Private Sub Kommandoknapp248_Click()
DoCmd.OpenQuery "Kundbort"
Me.Refresh
End If
 
Hello

Thank you for your answering. here is the delete commando

Private Sub Kommandoknapp248_Click()
DoCmd.OpenQuery "Kundbort"
Me.Refresh
End If

Do you have a question, Barcode?

Without knowing anything about "Kundbort" it's impossible to say anything
about this code.
 
Hello

The query which contained at [forms]![Kontaktinformation]![Mobiltelefon],it
deletes the actual post
that is on a form
then when it be deleted, My question is how can I clean the fields from
"delete" words that is inside
?

Here is my project that I am working on it. You can delete a post and see
that all fields will view
what I am asking about.
When you click on buttom DELETE Customer , you have to be already on the
"Customer" worksheet and then
delete the post.

Here is my project.

http://w5.nuinternet.com/s650100026/databas1.accdb

Best wishes
Good luck
 
So you're using a delete query to delete the record, instead of deleting the
record within the form?

Try this code:

Private Sub Kommandoknapp248_Click()
DoCmd.OpenQuery "Kundbort"
DoEvents
Me.Requery
End If
 
Thank you very much.
I tested it and it worked very well, I deal with you but how can I change
the following code which is inside the query, to be within the form?

Here is the code:

DELETE Kontakter.Mobiltelefon
FROM Kontakter
WHERE
(((Kontakter.Mobiltelefon)=[forms]![Kontaktinformation]![Mobiltelefon]));

Do you have a better way than the above code?
 
Thank you very much.
I tested it and it worked very well, I deal with you but how can I change
the following code which is inside the query, to be within the form?

Here is the code:

DELETE Kontakter.Mobiltelefon
FROM Kontakter
WHERE
(((Kontakter.Mobiltelefon)=[forms]![Kontaktinformation]![Mobiltelefon]));

Do you have a better way than the above code?

If you want to delete the current record on the form, just... delete the
current record on the form! It's not necessary to run a query to do so.

Do you want to actually delete the complete record in the table, or do you
want to just empty the Mobiltelefon field (leaving the rest of the record
intact)?
 
Back
Top