Open Form to Specific Record

rhodes92

Registered User.
Local time
Today, 15:47
Joined
Jan 14, 2013
Messages
10
No I know this one has been done, and I have a form with a button that this works on. Here is my problem. I have a list of parts in a continuous form, I added a button to open that specific record in a detail view and it works just fine. I used an open form macro and put in the criteria

="[Description]=" & "'" & [Description] & "'"

No problem.

I have tried to use this similar procedure for another form, it however has two subforms in it and I get a data type mismatch in criteria exception error. I have looked for this and cannot find any mismatch. I suspect that it has something to do with the subforms but am not sure. Any help would be much appreciated
 
It is close to working with your fix i used this

DoCmd.OpenForm "Ticket Entry", , , "[Ticket Number] = " & Me.[Ticket Number]

What it does do is opens the form, but it shows two records, a new record and the record that I want, It opens on the new record then if I navigate back I get the record I am looking for. Not sure why that is
 
It sounds like there may be code running either after this or in the form being opened to navigate to a new record.
 
not sure, havent been able to find it. I did make a work around, I added code to navigate to the first record when I hit the button and it seems to be working. It s not pretty but its doing the job.
 
If you can post the db here I'll see if I can find it.
 
for some reason it doesnt want to let me attach the db
 
hi,

I think that you have a syntax error,

DoCmd.OpenForm "Ticket Entry", , , "[Ticket Number] =" & Me.Ticket_Number

contractor
 
Okay, got the upload to work, I tried the new syntax and I get the same problem, it does find the record but brings up a new record in front of it. Its on the form tickets when I click the open button
 

Attachments

Check out the embedded macro in the "Ticket Entry" form's load event.
 
Indeed, remove embedded macro on the form "Ticket Entry" load event,

if you want to add a new data just use the following line
DoCmd.OpenForm "Ticket Entry", , , , acFormAdd

contractor
 
I knew it was going to be something stupid that I did wrong. Thank you guys so much, another set of eyes was needed, not sure how many times I missed that lol
 

Users who are viewing this thread

Back
Top Bottom