Solved

Issue with linking a form to another form (specific record)

Posted on 2014-09-11
6
219 Views
Last Modified: 2014-10-09
I have an issue where I am trying to link records to a specific record. So when you click on the record in an access form, it should open up the form with that record.

Now I have to mention that the field with the criteria is a text ( I had to do a text rather then a number for specific reasons)

I created a macro which runs onclick and I have attached the picture of what the macro shows. I have done this several other times.

However, when I click on the field with the onclick action it gives me a "data mismatch criteria error"

I know both fields are text. Does access maybe convert one field into number? is there a workaround it?

thanks,
link.PNG
0
Comment
Question by:damixa
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 84
ID: 40317851
What's the Datatype of the [ID1] field on frm_Full_View1? And what is the value of [ID1] that you're passing in? Generally speaking, Datatype Mismatch means exactly what it says - the data you're using doesn't "match" the datatype you're working with.
0
 

Author Comment

by:damixa
ID: 40317855
Thats the thing, they are both text
0
 
LVL 84

Assisted Solution

by:Scott McDaniel (Microsoft Access MVP - EE MVE )
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 250 total points
ID: 40317862
Then you must enclose the "value" in single quotes. Your Where condition should be something like:

"[ID1]='" & [ID1] & "'"

I'm not sure if you need the preceding "=" in there or not ... I've not used macros in a looong time.
0
 
LVL 31

Accepted Solution

by:
Helen_Feddema earned 250 total points
ID: 40319414
Alternatively, you can use Chr(39), which is longer but easier to decipher than a nest of single and double quotes.  It is also advisable to save the value from the form to a variable, so you can examine it in the Immediate Window.

This is for VBA code -- I don't think you can set a variable in a macro, but the other line should work.

strID = Me![ID1]
"[ID1] = " & Chr(39) & strID & Chr(39)
0
 
LVL 47

Expert Comment

by:Martin Liss
ID: 40370222
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question